string-range-expander 4.2.0 → 4.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,12 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.2.2 (2026-09-01)
7
+
8
+ ### Bug Fixes
9
+
10
+ - enforce range expander boundaries ([44e8500](https://github.com/codsen/codsen/commit/44e85002283cdd592cab2c3ef0a8404243d22b3f))
11
+ - enforce range expander option types ([1d560f0](https://github.com/codsen/codsen/commit/1d560f0f730418ab86a13d75862dec9c060dc5b3))
12
+ - mirror crop marker expansion ([60f417b](https://github.com/codsen/codsen/commit/60f417b5e9dc93772e776d55c7b40884115573c7))
13
+ - preserve international token boundaries ([7cf225d](https://github.com/codsen/codsen/commit/7cf225d1f4472614bbe5efe2e9b54770d6622a6f))
14
+ - preserve Unicode marker boundaries ([4e51bc8](https://github.com/codsen/codsen/commit/4e51bc8149bd7adb3a43e229921d44149fd4d2b4))
15
+
16
+ ### Performance Improvements
17
+
18
+ - benchmark representative range expansion ([dbc0cfa](https://github.com/codsen/codsen/commit/dbc0cfaa045a740130c48ae2ca4f813719a9c800))
19
+ - refresh range expander baseline ([a06eccf](https://github.com/codsen/codsen/commit/a06eccff6189a8c528820599bc82858604c349d2))
20
+
21
+ ## 4.2.1 (2026-08-22)
22
+
23
+ ### Performance Improvements
24
+
25
+ - optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
26
+
6
27
  ## 4.2.0 (2026-08-19)
7
28
 
8
29
  ### Bug Fixes
9
30
 
10
31
  - make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
11
- - resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
32
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
33
  - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
34
  - standardise range expander errs ([67d9156](https://github.com/codsen/codsen/commit/67d91562a045bc0deefde365cb4a03fdcff215fb))
14
35
 
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @name string-range-expander
3
3
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
4
- * @version 4.2.0
4
+ * @version 4.2.2
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-range-expander/}
8
8
  */
9
9
 
10
- import{formatDiagnosticValue as d,isInt as c,isPlainObject as T,isStr as s}from"codsen-utils";var a="4.2.0";var $=a,u={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function S(e){let h=/^[0-9a-zA-Z]+$/;function l(t){return s(t)&&!t.trim()}if(T(e)){if(!Object.keys(e).length)throw new Error(`string-range-expander/expander(): [THROW_ID_02] Input must be a plain object but it's been given as a plain object without any keys. However, "from" and "to" settings are obligatory!`)}else{let t;throw e===void 0?t="but it is missing completely.":e===null?t="but it was given as null.":t=`but it was given as ${typeof e}, equal to:
11
- ${d(e,4)}.`,new Error(`string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ${t}`)}if(!c(e.from))throw new Error(`string-range-expander/expander(): [THROW_ID_03] The input's "from" value resolvedOpts.from, is not a number! It's been given as ${typeof e.from}, equal to ${d(e.from)}`);if(!c(e.to))throw new Error(`string-range-expander/expander(): [THROW_ID_04] The input's "to" value resolvedOpts.to, is not a number! It's been given as ${typeof e.to}, equal to ${d(e.to)}`);if(e?.str&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander/expander(): [THROW_ID_05] The given input string resolvedOpts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if(e?.str&&!e.str[e.to-1])throw new Error(`string-range-expander/expander(): [THROW_ID_06] The given input string, resolvedOpts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander/expander(): [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(e.extendToOneSide===null||s(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!s(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error(`string-range-expander/expander(): [THROW_ID_08] The options value "extendToOneSide" is not recognisable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or one of strings: "left" or "right"`);if(e?.ifLeftSideIncludesThisThenCropTightly&&!s(e.ifLeftSideIncludesThisThenCropTightly))throw new Error(`string-range-expander/expander(): [THROW_ID_09] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It's been given as ${typeof e.ifLeftSideIncludesThisThenCropTightly}, equal to ${d(e.ifLeftSideIncludesThisThenCropTightly)}`);if(e?.ifLeftSideIncludesThisCropItToo&&!s(e.ifLeftSideIncludesThisCropItToo))throw new Error(`string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisCropItToo", is not a string! It's been given as ${typeof e.ifLeftSideIncludesThisCropItToo}, equal to ${d(e.ifLeftSideIncludesThisCropItToo)}`);if(e?.ifRightSideIncludesThisThenCropTightly&&!s(e.ifRightSideIncludesThisThenCropTightly))throw new Error(`string-range-expander/expander(): [THROW_ID_11] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It's been given as ${typeof e.ifRightSideIncludesThisThenCropTightly}, equal to ${d(e.ifRightSideIncludesThisThenCropTightly)}`);if(e?.ifRightSideIncludesThisCropItToo&&!s(e.ifRightSideIncludesThisCropItToo))throw new Error(`string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisCropItToo", is not a string! It's been given as ${typeof e.ifRightSideIncludesThisCropItToo}, equal to ${d(e.ifRightSideIncludesThisCropItToo)}`);let i={...u,...e},n=i.str,r=i.from,o=i.to;if(i.extendToOneSide!=="right"&&(l(n[r-1])&&(l(n[r-2])||i.ifLeftSideIncludesThisCropItToo.includes(n[r-2]))||n[r-1]&&i.ifLeftSideIncludesThisCropItToo.includes(n[r-1])||i.wipeAllWhitespaceOnLeft&&l(n[r-1]))){for(let t=r;t--;)if(!i.ifLeftSideIncludesThisCropItToo.includes(n[t])){if(n[t].trim()){i.wipeAllWhitespaceOnLeft||i.ifLeftSideIncludesThisCropItToo.includes(n[t+1])?r=t+1:r=t+2;break}else if(t===0){i.wipeAllWhitespaceOnLeft?r=0:r=1;break}}}if(i.extendToOneSide!=="left"&&(l(n[o])&&(i.wipeAllWhitespaceOnRight||l(n[o+1]))||i.ifRightSideIncludesThisCropItToo.includes(n[o]))){for(let t=o,f=n.length;t<f;t++)if(!i.ifRightSideIncludesThisCropItToo.includes(n[t])){if(n[t].trim()){i.wipeAllWhitespaceOnRight||i.ifRightSideIncludesThisCropItToo.includes(n[t-1])?o=t:o=t-1;break}else if(t===n.length-1){i.wipeAllWhitespaceOnRight?o=n.length:o=n.length-1;break}}}return(i.extendToOneSide!=="right"&&s(i.ifLeftSideIncludesThisThenCropTightly)&&i.ifLeftSideIncludesThisThenCropTightly&&(n[r-2]&&i.ifLeftSideIncludesThisThenCropTightly.includes(n[r-2])||n[r-1]&&i.ifLeftSideIncludesThisThenCropTightly.includes(n[r-1]))||i.extendToOneSide!=="left"&&s(i.ifRightSideIncludesThisThenCropTightly)&&i.ifRightSideIncludesThisThenCropTightly&&(n[o+1]&&i.ifRightSideIncludesThisThenCropTightly.includes(n[o+1])||n[o]&&i.ifRightSideIncludesThisThenCropTightly.includes(n[o])))&&(i.extendToOneSide!=="right"&&l(n[r-1])&&!i.wipeAllWhitespaceOnLeft&&(r-=1),i.extendToOneSide!=="left"&&l(n[o])&&!i.wipeAllWhitespaceOnRight&&(o+=1)),i.addSingleSpaceToPreventAccidentalConcatenation&&n[r-1]?.trim()&&n[o]?.trim()&&(!i.ifLeftSideIncludesThisThenCropTightly&&!i.ifRightSideIncludesThisThenCropTightly||!((!i.ifLeftSideIncludesThisThenCropTightly||i.ifLeftSideIncludesThisThenCropTightly.includes(n[r-1]))&&(!i.ifRightSideIncludesThisThenCropTightly||n[o]&&i.ifRightSideIncludesThisThenCropTightly.includes(n[o]))))&&(h.test(n[r-1])||h.test(n[o]))?[r,o," "]:[r,o]}export{u as defaults,S as expander,$ as version};
10
+ import{formatDiagnosticValue as s,isInt as m,isPlainObject as w,isStr as a}from"codsen-utils";var u="4.2.2";var x=["_16_0_7_1_1_0_3_1_1_2_1_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1","_11_2_0_6_14_1z_q_4_3_19_16_l_9_4_1_1_2q_1_0_f_1_7_e_2_0_g_0_1_t_t_2g_b_0_e_16_9_1_4_0_5_l_4_0_9_0_3","_0_n_o_7_a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_4_9_1_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_4_b_2_5_2_","0_8_5_4_1_2_l_1_6_1_1_1_1_1_1_v_3_1_0_7_9_2_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_4_9_9_0_b_7_2_1_2_","l_1_6_1_1_1_4_3_0_u_1_1_2_4_9_1_6_b_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_l_c_i_7_1_2_1_m_1_f_3_","0_q_2_1_1_2_1_4_9_8_6_1_0_4_7_1_2_1_m_1_9_1_4_3_0_u_2_1_1_4_9_1_1_h_8_1_2_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1_t_i_9_1c6_fs_7_u_1_9_","6_26_1_9_6_t_i_1b_g_3_c_9_1_6_1_k_5_i_c0_18_3_9_5i_2e_9_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_4_9_5p1_15_v","_2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_386_9_152_j_c_j_30_o_3r_2c_1_1y_1_","1_2_0_2_1_2_3_1_b_1_0_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_","1_u_1_o_1_7_2_1d_1ds_u_6_5_79_1p_42_18_a_6_2_9_4_0_8x_t_i_17_4_9_d2_r_4_9_5y_t_2_a_5h_u_1_2_1_1_1_6_","2_4_9_1_68_6_1_3_1_1_1_e_1_5g_2_8_1c_1v_7_0_4_9_lz_1m_1_2_1_3_24_18_1_e_5e_3_1_q_1_1_1_0_2_0_1_9_1_3","_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4","_1_g_g4_c_25f_9_sm_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),f=x.slice(1).split("_"),g=[],p=127;for(let _=0;_<f.length;_+=2){let n=p+1+Number.parseInt(f[_],36),e=n+Number.parseInt(f[_+1],36);g.push([n,e]),p=e}function T(_){if(Number.isNaN(_)||_<128||_>1114111)return!1;let n=0,e=g.length-1;for(;n<=e;){let i=n+e>>1,t=g[i];if(_<t[0])e=i-1;else if(_>t[1])n=i+1;else return!0}return!1}var A=u;function l(_,n,e){let i=n[e];if(!_||!i||!_.includes(i))return!1;let t=i.charCodeAt(0),r=e,o=e+1;if(!(t>=55296&&t<=56319&&n.charCodeAt(o)>=56320&&n.charCodeAt(o)<=57343))if(t>=56320&&t<=57343&&n.charCodeAt(e-1)>=55296&&n.charCodeAt(e-1)<=56319)r=e-1,o=e;else return _.includes(n[e]);let c=n.charCodeAt(r),b=n.charCodeAt(o);for(let h=0;h<_.length-1;h++)if(_.charCodeAt(h)===c&&_.charCodeAt(h+1)===b)return!0;return!1}function I(_,n){let e=_.charCodeAt(n);if(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)return!0;let i=e;return e>=55296&&e<=56319&&_.charCodeAt(n+1)>=56320&&_.charCodeAt(n+1)<=57343?i=(e-55296)*1024+(_.charCodeAt(n+1)-56320)+65536:e>=56320&&e<=57343&&_.charCodeAt(n-1)>=55296&&_.charCodeAt(n-1)<=56319&&(i=(_.charCodeAt(n-1)-55296)*1024+(e-56320)+65536),T(i)}var d={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function v(_){function n(o){return a(o)&&!o.trim()}if(w(_)){if(!Object.keys(_).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object with the required "str", "from", and "to" keys, but it was given without any keys.')}else{let o;throw _===void 0?o="but it is missing completely.":_===null?o="but it was given as null.":o=`but it was given as ${typeof _}, equal to:
11
+ ${s(_,4)}.`,new Error(`string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ${o}`)}if(!a(_.str))throw new Error(`string-range-expander/expander(): [THROW_ID_03] The input's "str" value must be a string! It was given as ${typeof _.str}, equal to ${s(_.str)}`);if(!m(_.from)||_.from<0)throw new Error(`string-range-expander/expander(): [THROW_ID_04] The input's "from" value must be a non-negative integer! It was given as ${typeof _.from}, equal to ${s(_.from)}`);if(!m(_.to)||_.to<0)throw new Error(`string-range-expander/expander(): [THROW_ID_05] The input's "to" value must be a non-negative integer! It was given as ${typeof _.to}, equal to ${s(_.to)}`);if(_.from>_.str.length)throw new Error(`string-range-expander/expander(): [THROW_ID_06] The input's "from" value (${_.from}) must not exceed the string length (${_.str.length}).`);if(_.to>_.str.length)throw new Error(`string-range-expander/expander(): [THROW_ID_07] The input's "to" value (${_.to}) must not exceed the string length (${_.str.length}).`);if(_.from>_.to)throw new Error(`string-range-expander/expander(): [THROW_ID_08] The input's "from" value (${_.from}) must not exceed its "to" value (${_.to}).`);if(_.extendToOneSide!==void 0&&_.extendToOneSide!==!1&&_.extendToOneSide!=="left"&&_.extendToOneSide!=="right")throw new Error(`string-range-expander/expander(): [THROW_ID_09] The options value "extendToOneSide" is not recognisable! It's set to: "${_.extendToOneSide}" (${typeof _.extendToOneSide}). It has to be either Boolean "false" or one of strings: "left" or "right"`);if(_.ifLeftSideIncludesThisThenCropTightly!==void 0&&!a(_.ifLeftSideIncludesThisThenCropTightly))throw new Error(`string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It's been given as ${typeof _.ifLeftSideIncludesThisThenCropTightly}, equal to ${s(_.ifLeftSideIncludesThisThenCropTightly)}`);if(_.ifLeftSideIncludesThisCropItToo!==void 0&&!a(_.ifLeftSideIncludesThisCropItToo))throw new Error(`string-range-expander/expander(): [THROW_ID_11] The option "ifLeftSideIncludesThisCropItToo", is not a string! It's been given as ${typeof _.ifLeftSideIncludesThisCropItToo}, equal to ${s(_.ifLeftSideIncludesThisCropItToo)}`);if(_.ifRightSideIncludesThisThenCropTightly!==void 0&&!a(_.ifRightSideIncludesThisThenCropTightly))throw new Error(`string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It's been given as ${typeof _.ifRightSideIncludesThisThenCropTightly}, equal to ${s(_.ifRightSideIncludesThisThenCropTightly)}`);if(_.ifRightSideIncludesThisCropItToo!==void 0&&!a(_.ifRightSideIncludesThisCropItToo))throw new Error(`string-range-expander/expander(): [THROW_ID_13] The option "ifRightSideIncludesThisCropItToo", is not a string! It's been given as ${typeof _.ifRightSideIncludesThisCropItToo}, equal to ${s(_.ifRightSideIncludesThisCropItToo)}`);if(_.wipeAllWhitespaceOnLeft!==void 0&&typeof _.wipeAllWhitespaceOnLeft!="boolean")throw new Error(`string-range-expander/expander(): [THROW_ID_14] The option "wipeAllWhitespaceOnLeft" must be a Boolean! It was given as ${typeof _.wipeAllWhitespaceOnLeft}, equal to ${s(_.wipeAllWhitespaceOnLeft)}`);if(_.wipeAllWhitespaceOnRight!==void 0&&typeof _.wipeAllWhitespaceOnRight!="boolean")throw new Error(`string-range-expander/expander(): [THROW_ID_15] The option "wipeAllWhitespaceOnRight" must be a Boolean! It was given as ${typeof _.wipeAllWhitespaceOnRight}, equal to ${s(_.wipeAllWhitespaceOnRight)}`);if(_.addSingleSpaceToPreventAccidentalConcatenation!==void 0&&typeof _.addSingleSpaceToPreventAccidentalConcatenation!="boolean")throw new Error(`string-range-expander/expander(): [THROW_ID_16] The option "addSingleSpaceToPreventAccidentalConcatenation" must be a Boolean! It was given as ${typeof _.addSingleSpaceToPreventAccidentalConcatenation}, equal to ${s(_.addSingleSpaceToPreventAccidentalConcatenation)}`);let e={...d,..._,ifLeftSideIncludesThisThenCropTightly:_.ifLeftSideIncludesThisThenCropTightly??d.ifLeftSideIncludesThisThenCropTightly,ifLeftSideIncludesThisCropItToo:_.ifLeftSideIncludesThisCropItToo??d.ifLeftSideIncludesThisCropItToo,ifRightSideIncludesThisThenCropTightly:_.ifRightSideIncludesThisThenCropTightly??d.ifRightSideIncludesThisThenCropTightly,ifRightSideIncludesThisCropItToo:_.ifRightSideIncludesThisCropItToo??d.ifRightSideIncludesThisCropItToo,extendToOneSide:_.extendToOneSide??d.extendToOneSide,wipeAllWhitespaceOnLeft:_.wipeAllWhitespaceOnLeft??d.wipeAllWhitespaceOnLeft,wipeAllWhitespaceOnRight:_.wipeAllWhitespaceOnRight??d.wipeAllWhitespaceOnRight,addSingleSpaceToPreventAccidentalConcatenation:_.addSingleSpaceToPreventAccidentalConcatenation??d.addSingleSpaceToPreventAccidentalConcatenation},i=e.str,t=e.from,r=e.to;if(e.extendToOneSide!=="right"&&(n(i[t-1])&&(n(i[t-2])||l(e.ifLeftSideIncludesThisCropItToo,i,t-2))||i[t-1]&&l(e.ifLeftSideIncludesThisCropItToo,i,t-1)||e.wipeAllWhitespaceOnLeft&&n(i[t-1]))){for(let o=t;o--;)if(!l(e.ifLeftSideIncludesThisCropItToo,i,o)){if(i[o].trim()){e.wipeAllWhitespaceOnLeft||l(e.ifLeftSideIncludesThisCropItToo,i,o+1)?t=o+1:t=o+2;break}else if(o===0){e.wipeAllWhitespaceOnLeft?t=0:t=1;break}}}if(e.extendToOneSide!=="left"&&(n(i[r])&&(e.wipeAllWhitespaceOnRight||n(i[r+1])||l(e.ifRightSideIncludesThisCropItToo,i,r+1))||l(e.ifRightSideIncludesThisCropItToo,i,r))){for(let o=r,c=i.length;o<c;o++)if(!l(e.ifRightSideIncludesThisCropItToo,i,o)){if(i[o].trim()){e.wipeAllWhitespaceOnRight||l(e.ifRightSideIncludesThisCropItToo,i,o-1)?r=o:r=o-1;break}else if(o===i.length-1){e.wipeAllWhitespaceOnRight?r=i.length:r=i.length-1;break}}}return(e.extendToOneSide!=="right"&&a(e.ifLeftSideIncludesThisThenCropTightly)&&e.ifLeftSideIncludesThisThenCropTightly&&(i[t-2]&&l(e.ifLeftSideIncludesThisThenCropTightly,i,t-2)||i[t-1]&&l(e.ifLeftSideIncludesThisThenCropTightly,i,t-1))||e.extendToOneSide!=="left"&&a(e.ifRightSideIncludesThisThenCropTightly)&&e.ifRightSideIncludesThisThenCropTightly&&(i[r+1]&&l(e.ifRightSideIncludesThisThenCropTightly,i,r+1)||i[r]&&l(e.ifRightSideIncludesThisThenCropTightly,i,r)))&&(e.extendToOneSide!=="right"&&n(i[t-1])&&!e.wipeAllWhitespaceOnLeft&&(t-=1),e.extendToOneSide!=="left"&&n(i[r])&&!e.wipeAllWhitespaceOnRight&&(r+=1)),e.addSingleSpaceToPreventAccidentalConcatenation&&i[t-1]?.trim()&&i[r]?.trim()&&(!e.ifLeftSideIncludesThisThenCropTightly&&!e.ifRightSideIncludesThisThenCropTightly||!((!e.ifLeftSideIncludesThisThenCropTightly||l(e.ifLeftSideIncludesThisThenCropTightly,i,t-1))&&(!e.ifRightSideIncludesThisThenCropTightly||i[r]&&l(e.ifRightSideIncludesThisThenCropTightly,i,r))))&&(I(i,t-1)||I(i,r))?[t,r," "]:[t,r]}export{d as defaults,v as expander,A as version};
@@ -1,17 +1,25 @@
1
1
  /**
2
2
  * @name string-range-expander
3
3
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
4
- * @version 4.2.0
4
+ * @version 4.2.2
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/string-range-expander/}
8
8
  */
9
9
 
10
- "use strict";var stringRangeExpander=(()=>{var y=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var C=(e,i,t)=>i in e?y(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,$=(e,i)=>{for(var t in i||(i={}))O.call(i,t)&&C(e,t,i[t]);if(w)for(var t of w(i))B.call(i,t)&&C(e,t,i[t]);return e};var M=(e,i)=>{for(var t in i)y(e,t,{get:i[t],enumerable:!0})},V=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of _(i))!O.call(e,r)&&r!==t&&y(e,r,{get:()=>i[r],enumerable:!(n=j(i,r))||n.enumerable});return e};var P=e=>V(y({},"__esModule",{value:!0}),e);var Q={};M(Q,{defaults:()=>W,expander:()=>K,version:()=>q});function H(){let e=[],i=0,t=!1;return{append(n){return t?!1:i+n.length>1999?(e.push("\u2026"),i+=1,t=!0,!1):(e.push(n),i+=n.length,!0)},result(){return e.join("")},stopped(){return t}}}function U(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function S(e,i){if(e.append('"')){for(let t=0;t<i.length&&!e.stopped();t+=1){let n=i.charCodeAt(t);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(U(n)):e.append(i[t])}e.append('"')}}function F(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function R(e,i){e.append("Symbol(");let t=String(i);t.length>8&&S(e,t.slice(7,-1)),e.append(")")}function A(e,i){typeof i=="symbol"?R(e,i):S(e,String(i))}function g(e,i=0){let t=H(),n=i===4?4:0,r=new WeakSet,s=0;function u(l){n&&t.append(" ".repeat(l*n))}function m(l,a){l&&t.append(","),n&&(t.append("\n"),u(a+1))}function b(l,a,f){n&&a&&(t.append("\n"),u(f)),t.append(l)}function o(l,a){Object.prototype.hasOwnProperty.call(l,"value")?x(l.value,a):t.append(F(l))}function I(l,a){let f;try{f=Reflect.getOwnPropertyDescriptor(l,"length")}catch(d){t.append("[Uninspectable]");return}let c=f==null?void 0:f.value;if(!Number.isSafeInteger(c)||c<0){t.append("[Uninspectable]");return}t.append("[");let p=!1;for(let d=0;d<c&&!t.stopped();d+=1){if(m(p,a),p=!0,s>=50){t.append("[MaxEntries]");break}s+=1;let T;try{T=Reflect.getOwnPropertyDescriptor(l,String(d))}catch(z){t.append("[Uninspectable]");continue}T!=null&&T.enumerable?o(T,a+1):t.append("[Empty]")}b("]",p,a)}function k(l,a){let f;try{f=Reflect.ownKeys(l)}catch(p){t.append("[Uninspectable]");return}t.append("{");let c=!1;for(let p of f){if(t.stopped())break;if(s>=50){m(c,a),c=!0,S(t,"\u2026"),t.append(n?": ":":"),t.append("[MaxEntries]");break}s+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(l,p)}catch(T){m(c,a),c=!0,A(t,p),t.append(n?": ":":"),t.append("[Uninspectable]");continue}d!=null&&d.enumerable&&(m(c,a),c=!0,A(t,p),t.append(n?": ":":"),o(d,a+1))}b("}",c,a)}function L(l,a){if(r.has(l)){t.append("[Circular]");return}if(a>=5){t.append("[MaxDepth]");return}let f;try{f=Array.isArray(l)}catch(c){t.append("[Uninspectable]");return}r.add(l);try{f?I(l,a):k(l,a)}finally{r.delete(l)}}function x(l,a){l===null?t.append("null"):typeof l=="string"?S(t,l):typeof l=="number"?t.append(Object.is(l,-0)?"-0":String(l)):typeof l=="boolean"?t.append(l?"true":"false"):typeof l>"u"?t.append("undefined"):typeof l=="bigint"?t.append("".concat(l,"n")):typeof l=="symbol"?R(t,l):typeof l=="function"?t.append("[Function]"):L(l,a)}try{return x(e,0),t.result()}catch(l){return"[Uninspectable]"}}var J=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);function D(e){if(e==null||typeof e!="object")return!1;let i=Object.getPrototypeOf(e);return i!==null&&i!==Object.prototype&&Object.getPrototypeOf(i)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function h(e){return typeof e=="string"}function v(e){return Number.isSafeInteger(e)&&e>=0}var E="4.2.0";var q=E,W={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function K(e){var m,b;let i=/^[0-9a-zA-Z]+$/;function t(o){return h(o)&&!o.trim()}if(D(e)){if(!Object.keys(e).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object but it\'s been given as a plain object without any keys. However, "from" and "to" settings are obligatory!')}else{let o;throw e===void 0?o="but it is missing completely.":e===null?o="but it was given as null.":o="but it was given as ".concat(typeof e,", equal to:\n").concat(g(e,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(o))}if(!v(e.from))throw new Error("string-range-expander/expander(): [THROW_ID_03] The input's \"from\" value resolvedOpts.from, is not a number! It's been given as ".concat(typeof e.from,", equal to ").concat(g(e.from)));if(!v(e.to))throw new Error("string-range-expander/expander(): [THROW_ID_04] The input's \"to\" value resolvedOpts.to, is not a number! It's been given as ".concat(typeof e.to,", equal to ").concat(g(e.to)));if(e!=null&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error('string-range-expander/expander(): [THROW_ID_05] The given input string resolvedOpts.str ("'.concat(e.str,'") must contain the character at index "from" ("').concat(e.from,'")'));if(e!=null&&e.str&&!e.str[e.to-1])throw new Error('string-range-expander/expander(): [THROW_ID_06] The given input string, resolvedOpts.str ("'.concat(e.str,'") must contain the character at index before "to" ("').concat(e.to-1,'")'));if(e.from>e.to)throw new Error('string-range-expander/expander(): [THROW_ID_07] The given "from" index, "'.concat(e.from,'" is greater than "to" index, "').concat(e.to,"\". That's wrong!"));if(e.extendToOneSide===null||h(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!h(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide)throw new Error('string-range-expander/expander(): [THROW_ID_08] The options value "extendToOneSide" is not recognisable! It\'s set to: "'.concat(e.extendToOneSide,'" (').concat(typeof e.extendToOneSide,'). It has to be either Boolean "false" or one of strings: "left" or "right"'));if(e!=null&&e.ifLeftSideIncludesThisThenCropTightly&&!h(e.ifLeftSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_09] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisThenCropTightly,", equal to ").concat(g(e.ifLeftSideIncludesThisThenCropTightly)));if(e!=null&&e.ifLeftSideIncludesThisCropItToo&&!h(e.ifLeftSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifLeftSideIncludesThisCropItToo,", equal to ").concat(g(e.ifLeftSideIncludesThisCropItToo)));if(e!=null&&e.ifRightSideIncludesThisThenCropTightly&&!h(e.ifRightSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_11] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisThenCropTightly,", equal to ").concat(g(e.ifRightSideIncludesThisThenCropTightly)));if(e!=null&&e.ifRightSideIncludesThisCropItToo&&!h(e.ifRightSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof e.ifRightSideIncludesThisCropItToo,", equal to ").concat(g(e.ifRightSideIncludesThisCropItToo)));let n=$($({},W),e),r=n.str,s=n.from,u=n.to;if(n.extendToOneSide!=="right"&&(t(r[s-1])&&(t(r[s-2])||n.ifLeftSideIncludesThisCropItToo.includes(r[s-2]))||r[s-1]&&n.ifLeftSideIncludesThisCropItToo.includes(r[s-1])||n.wipeAllWhitespaceOnLeft&&t(r[s-1]))){for(let o=s;o--;)if(!n.ifLeftSideIncludesThisCropItToo.includes(r[o])){if(r[o].trim()){n.wipeAllWhitespaceOnLeft||n.ifLeftSideIncludesThisCropItToo.includes(r[o+1])?s=o+1:s=o+2;break}else if(o===0){n.wipeAllWhitespaceOnLeft?s=0:s=1;break}}}if(n.extendToOneSide!=="left"&&(t(r[u])&&(n.wipeAllWhitespaceOnRight||t(r[u+1]))||n.ifRightSideIncludesThisCropItToo.includes(r[u]))){for(let o=u,I=r.length;o<I;o++)if(!n.ifRightSideIncludesThisCropItToo.includes(r[o])){if(r[o].trim()){n.wipeAllWhitespaceOnRight||n.ifRightSideIncludesThisCropItToo.includes(r[o-1])?u=o:u=o-1;break}else if(o===r.length-1){n.wipeAllWhitespaceOnRight?u=r.length:u=r.length-1;break}}}return(n.extendToOneSide!=="right"&&h(n.ifLeftSideIncludesThisThenCropTightly)&&n.ifLeftSideIncludesThisThenCropTightly&&(r[s-2]&&n.ifLeftSideIncludesThisThenCropTightly.includes(r[s-2])||r[s-1]&&n.ifLeftSideIncludesThisThenCropTightly.includes(r[s-1]))||n.extendToOneSide!=="left"&&h(n.ifRightSideIncludesThisThenCropTightly)&&n.ifRightSideIncludesThisThenCropTightly&&(r[u+1]&&n.ifRightSideIncludesThisThenCropTightly.includes(r[u+1])||r[u]&&n.ifRightSideIncludesThisThenCropTightly.includes(r[u])))&&(n.extendToOneSide!=="right"&&t(r[s-1])&&!n.wipeAllWhitespaceOnLeft&&(s-=1),n.extendToOneSide!=="left"&&t(r[u])&&!n.wipeAllWhitespaceOnRight&&(u+=1)),n.addSingleSpaceToPreventAccidentalConcatenation&&((m=r[s-1])!=null&&m.trim())&&((b=r[u])!=null&&b.trim())&&(!n.ifLeftSideIncludesThisThenCropTightly&&!n.ifRightSideIncludesThisThenCropTightly||!((!n.ifLeftSideIncludesThisThenCropTightly||n.ifLeftSideIncludesThisThenCropTightly.includes(r[s-1]))&&(!n.ifRightSideIncludesThisThenCropTightly||r[u]&&n.ifRightSideIncludesThisThenCropTightly.includes(r[u]))))&&(i.test(r[s-1])||i.test(r[u]))?[s,u," "]:[s,u]}return P(Q);})();
10
+ "use strict";var stringRangeExpander=(()=>{var x=Object.defineProperty,G=Object.defineProperties,J=Object.getOwnPropertyDescriptor,Z=Object.getOwnPropertyDescriptors,Y=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var D=(_,n,e)=>n in _?x(_,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):_[n]=e,C=(_,n)=>{for(var e in n||(n={}))W.call(n,e)&&D(_,e,n[e]);if(k)for(var e of k(n))X.call(n,e)&&D(_,e,n[e]);return _},L=(_,n)=>G(_,Z(n));var __=(_,n)=>{for(var e in n)x(_,e,{get:n[e],enumerable:!0})},e_=(_,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Y(n))!W.call(_,i)&&i!==e&&x(_,i,{get:()=>n[i],enumerable:!(t=J(n,i))||t.enumerable});return _};var t_=_=>e_(x({},"__esModule",{value:!0}),_);var d_={};__(d_,{defaults:()=>p,expander:()=>f_,version:()=>c_});function n_(){let _=[],n=0,e=!1;return{append(t){return e?!1:n+t.length>1999?(_.push("\u2026"),n+=1,e=!0,!1):(_.push(t),n+=t.length,!0)},result(){return _.join("")},stopped(){return e}}}function r_(_){return"\\u".concat(_.toString(16).padStart(4,"0"))}function I(_,n){if(_.append('"')){for(let e=0;e<n.length&&!_.stopped();e+=1){let t=n.charCodeAt(e);t===34?_.append('\\"'):t===92?_.append("\\\\"):t===8?_.append("\\b"):t===9?_.append("\\t"):t===10?_.append("\\n"):t===12?_.append("\\f"):t===13?_.append("\\r"):t<32||t===8232||t===8233||t>=55296&&t<=57343?_.append(r_(t)):_.append(n[e])}_.append('"')}}function i_(_){return _.get&&_.set?"[Getter/Setter]":_.get?"[Getter]":_.set?"[Setter]":"[Accessor]"}function P(_,n){_.append("Symbol(");let e=String(n);e.length>8&&I(_,e.slice(7,-1)),_.append(")")}function E(_,n){typeof n=="symbol"?P(_,n):I(_,String(n))}function c(_,n=0){let e=n_(),t=n===4?4:0,i=new WeakSet,o=0;function f(r){t&&e.append(" ".repeat(r*t))}function g(r,s){r&&e.append(","),t&&(e.append("\n"),f(s+1))}function y(r,s,l){t&&s&&(e.append("\n"),f(l)),e.append(r)}function d(r,s){Object.prototype.hasOwnProperty.call(r,"value")?w(r.value,s):e.append(i_(r))}function v(r,s){let l;try{l=Reflect.getOwnPropertyDescriptor(r,"length")}catch(h){e.append("[Uninspectable]");return}let a=l==null?void 0:l.value;if(!Number.isSafeInteger(a)||a<0){e.append("[Uninspectable]");return}e.append("[");let b=!1;for(let h=0;h<a&&!e.stopped();h+=1){if(g(b,s),b=!0,o>=50){e.append("[MaxEntries]");break}o+=1;let T;try{T=Reflect.getOwnPropertyDescriptor(r,String(h))}catch(h_){e.append("[Uninspectable]");continue}T!=null&&T.enumerable?d(T,s+1):e.append("[Empty]")}y("]",b,s)}function S(r,s){let l;try{l=Reflect.ownKeys(r)}catch(b){e.append("[Uninspectable]");return}e.append("{");let a=!1;for(let b of l){if(e.stopped())break;if(o>=50){g(a,s),a=!0,I(e,"\u2026"),e.append(t?": ":":"),e.append("[MaxEntries]");break}o+=1;let h;try{h=Reflect.getOwnPropertyDescriptor(r,b)}catch(T){g(a,s),a=!0,E(e,b),e.append(t?": ":":"),e.append("[Uninspectable]");continue}h!=null&&h.enumerable&&(g(a,s),a=!0,E(e,b),e.append(t?": ":":"),d(h,s+1))}y("}",a,s)}function O(r,s){if(i.has(r)){e.append("[Circular]");return}if(s>=5){e.append("[MaxDepth]");return}let l;try{l=Array.isArray(r)}catch(a){e.append("[Uninspectable]");return}i.add(r);try{l?v(r,s):S(r,s)}finally{i.delete(r)}}function w(r,s){r===null?e.append("null"):typeof r=="string"?I(e,r):typeof r=="number"?e.append(Object.is(r,-0)?"-0":String(r)):typeof r=="boolean"?e.append(r?"true":"false"):typeof r>"u"?e.append("undefined"):typeof r=="bigint"?e.append("".concat(r,"n")):typeof r=="symbol"?P(e,r):typeof r=="function"?e.append("[Function]"):O(r,s)}try{return w(_,0),e.result()}catch(r){return"[Uninspectable]"}}var l_=["_16_0_a_0_4_0_5_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_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_d_0_1z_q_11_6_55_17_38_1r_v_","7_2_0_2_7_1_1_1_n_f_0_1_0_2m_7_2_12_g_0_1_0_s_0_a_13_7_0_l_0_b_19_j_0_i_20_5j_w_v_8_1_10_h_0_1d_t_34","_6_1_1_1_11_l_0_p_5_1_1_1_v_e_0_n_17_78_i_f_0_1_c_1_x_3g_0_27_pl_6e_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a","1_t_1cy_fs_7_u_h_26_h_t_i_1b_g_3_v_k_5_i_c0_18_5v_1r_w_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_1_c_5p1_15_v_","2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_4me_2c_1_1y_1_1_2_0_2_1_2_3_1_b_1_0","_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_u_1_o_1_7_1f8_u_6_5","_79_1p_42_18_a_6_g_0_8x_t_i_17_dg_r_6c_t_2_0_5r_u_1_2_1_1_1_6_2_4_9_1_68_6_1_3_1_1_1_e_1_5g_1n_1v_7_","0_xg_3_1_q_1_1_1_0_2_0_1_9_1_3_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1","_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4_1_g_3es_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),A=l_.slice(1).split("_"),o_=[],q=127;for(let _=0;_<A.length;_+=2){let n=q+1+Number.parseInt(A[_],36),e=n+Number.parseInt(A[_+1],36);o_.push([n,e]),q=e}var y_=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var M=Function.prototype.toString,s_=M.call(Object);var T_=Map.prototype.entries,w_=Set.prototype.values;var z,v_=(z=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:z.get,B,S_=(B=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:B.get,V,O_=(V=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:V.get,N,x_=(N=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:N.get,I_=RegExp.prototype.test;function U(_){var t;if(_==null||typeof _!="object")return!1;let n=Object.getPrototypeOf(_);if(n===null||n===Object.prototype)return!0;let e=Object.getOwnPropertyDescriptor(n,"constructor");return!e||!("value"in e)||typeof e.value!="function"?!1:((t=Object.getOwnPropertyDescriptor(e.value,"prototype"))==null?void 0:t.value)===n&&M.call(e.value)===s_}function m(_){return typeof _=="string"}function $(_){return Number.isSafeInteger(_)&&_>=0}var C_=Date.prototype.getTime;var H="4.2.2";var u_=["_16_0_7_1_1_0_3_1_1_2_1_m_1_u_1_cp_4_b_e_4_7_0_1_0_3l_4_1_1_2_3_1_0_6_0_1_2_1_0_1_j_1_2a_1_3u_8_4l_1","_11_2_0_6_14_1z_q_4_3_19_16_l_9_4_1_1_2q_1_0_f_1_7_e_2_0_g_0_1_t_t_2g_b_0_e_16_9_1_4_0_5_l_4_0_9_0_3","_0_n_o_7_a_5_n_1_6_g_15_1m_1h_3_0_i_0_7_9_4_9_1_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_4_b_2_5_2_","0_8_5_4_1_2_l_1_6_1_1_1_1_1_1_v_3_1_0_7_9_2_2_g_8_1_2_1_l_1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7_1_1_1_n_f_0_1_0_e_9_1y_7_2_12_g_0_1_0_s_0_a_13_7_","0_l_0_b_19_j_0_i_20_5j_w_f_9_6_8_1_10_h_0_f_s_5_t_34_6_1_1_1_11_l_0_9_9_6_5_1_1_1_v_e_0_7_9_6_17_4_9","_6u_i_f_0_1_c_1_x_s_9_2e_0_f_k_17_pl_2u_32_h_5f_218_2o_f_tr_h_5_p_32y_5_g6_5a1_t_i_9_1c6_fs_7_u_1_9_","6_26_1_9_6_t_i_1b_g_3_c_9_1_6_1_k_5_i_c0_18_3_9_5i_2e_9_o_2_o_18_22_5_0_1u_c_1s_1_1_0_e_4_9_5p1_15_v","_2p_36_6pp_3_1_6_1_1_1_82_f_0_t_2_2_0_e_3_8_az_1s4_2y_5_c_3_8_7_9_386_9_152_j_c_j_30_o_3r_2c_1_1y_1_","1_2_0_2_1_2_3_1_b_1_0_1_6_1_1s_1_3_2_7_1_6_1_r_1_3_1_4_1_0_3_6_1_9f_2_o_1_o_1_u_1_o_1_u_1_o_1_u_1_o_","1_u_1_o_1_7_2_1d_1ds_u_6_5_79_1p_42_18_a_6_2_9_4_0_8x_t_i_17_4_9_d2_r_4_9_5y_t_2_a_5h_u_1_2_1_1_1_6_","2_4_9_1_68_6_1_3_1_1_1_e_1_5g_2_8_1c_1v_7_0_4_9_lz_1m_1_2_1_3_24_18_1_e_5e_3_1_q_1_1_1_0_2_0_1_9_1_3","_1_0_1_0_6_0_4_0_1_0_1_0_1_2_1_1_1_0_2_0_1_0_1_0_1_0_1_0_1_1_1_0_2_3_1_6_1_3_1_3_1_0_1_9_1_g_5_2_1_4","_1_g_g4_c_25f_9_sm_wyn_w_3dp_2_4gd_2_5rk_f_h9_1wi_f1_15u_3t6_5_6jt"].join(""),R=u_.slice(1).split("_"),j=[],F=127;for(let _=0;_<R.length;_+=2){let n=F+1+Number.parseInt(R[_],36),e=n+Number.parseInt(R[_+1],36);j.push([n,e]),F=e}function K(_){if(Number.isNaN(_)||_<128||_>1114111)return!1;let n=0,e=j.length-1;for(;n<=e;){let t=n+e>>1,i=j[t];if(_<i[0])e=t-1;else if(_>i[1])n=t+1;else return!0}return!1}var c_=H;function u(_,n,e){let t=n[e];if(!_||!t||!_.includes(t))return!1;let i=t.charCodeAt(0),o=e,f=e+1;if(!(i>=55296&&i<=56319&&n.charCodeAt(f)>=56320&&n.charCodeAt(f)<=57343))if(i>=56320&&i<=57343&&n.charCodeAt(e-1)>=55296&&n.charCodeAt(e-1)<=56319)o=e-1,f=e;else return _.includes(n[e]);let g=n.charCodeAt(o),y=n.charCodeAt(f);for(let d=0;d<_.length-1;d++)if(_.charCodeAt(d)===g&&_.charCodeAt(d+1)===y)return!0;return!1}function Q(_,n){let e=_.charCodeAt(n);if(e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122)return!0;let t=e;return e>=55296&&e<=56319&&_.charCodeAt(n+1)>=56320&&_.charCodeAt(n+1)<=57343?t=(e-55296)*1024+(_.charCodeAt(n+1)-56320)+65536:e>=56320&&e<=57343&&_.charCodeAt(n-1)>=55296&&_.charCodeAt(n-1)<=56319&&(t=(_.charCodeAt(n-1)-55296)*1024+(e-56320)+65536),K(t)}var p={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function f_(_){var f,g,y,d,v,S,O,w,r,s;function n(l){return m(l)&&!l.trim()}if(U(_)){if(!Object.keys(_).length)throw new Error('string-range-expander/expander(): [THROW_ID_02] Input must be a plain object with the required "str", "from", and "to" keys, but it was given without any keys.')}else{let l;throw _===void 0?l="but it is missing completely.":_===null?l="but it was given as null.":l="but it was given as ".concat(typeof _,", equal to:\n").concat(c(_,4),"."),new Error("string-range-expander/expander(): [THROW_ID_01] Input must be a plain object ".concat(l))}if(!m(_.str))throw new Error('string-range-expander/expander(): [THROW_ID_03] The input\'s "str" value must be a string! It was given as '.concat(typeof _.str,", equal to ").concat(c(_.str)));if(!$(_.from)||_.from<0)throw new Error('string-range-expander/expander(): [THROW_ID_04] The input\'s "from" value must be a non-negative integer! It was given as '.concat(typeof _.from,", equal to ").concat(c(_.from)));if(!$(_.to)||_.to<0)throw new Error('string-range-expander/expander(): [THROW_ID_05] The input\'s "to" value must be a non-negative integer! It was given as '.concat(typeof _.to,", equal to ").concat(c(_.to)));if(_.from>_.str.length)throw new Error('string-range-expander/expander(): [THROW_ID_06] The input\'s "from" value ('.concat(_.from,") must not exceed the string length (").concat(_.str.length,")."));if(_.to>_.str.length)throw new Error('string-range-expander/expander(): [THROW_ID_07] The input\'s "to" value ('.concat(_.to,") must not exceed the string length (").concat(_.str.length,")."));if(_.from>_.to)throw new Error('string-range-expander/expander(): [THROW_ID_08] The input\'s "from" value ('.concat(_.from,') must not exceed its "to" value (').concat(_.to,")."));if(_.extendToOneSide!==void 0&&_.extendToOneSide!==!1&&_.extendToOneSide!=="left"&&_.extendToOneSide!=="right")throw new Error('string-range-expander/expander(): [THROW_ID_09] The options value "extendToOneSide" is not recognisable! It\'s set to: "'.concat(_.extendToOneSide,'" (').concat(typeof _.extendToOneSide,'). It has to be either Boolean "false" or one of strings: "left" or "right"'));if(_.ifLeftSideIncludesThisThenCropTightly!==void 0&&!m(_.ifLeftSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_10] The option "ifLeftSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof _.ifLeftSideIncludesThisThenCropTightly,", equal to ").concat(c(_.ifLeftSideIncludesThisThenCropTightly)));if(_.ifLeftSideIncludesThisCropItToo!==void 0&&!m(_.ifLeftSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_11] The option "ifLeftSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof _.ifLeftSideIncludesThisCropItToo,", equal to ").concat(c(_.ifLeftSideIncludesThisCropItToo)));if(_.ifRightSideIncludesThisThenCropTightly!==void 0&&!m(_.ifRightSideIncludesThisThenCropTightly))throw new Error('string-range-expander/expander(): [THROW_ID_12] The option "ifRightSideIncludesThisThenCropTightly", is not a string! It\'s been given as '.concat(typeof _.ifRightSideIncludesThisThenCropTightly,", equal to ").concat(c(_.ifRightSideIncludesThisThenCropTightly)));if(_.ifRightSideIncludesThisCropItToo!==void 0&&!m(_.ifRightSideIncludesThisCropItToo))throw new Error('string-range-expander/expander(): [THROW_ID_13] The option "ifRightSideIncludesThisCropItToo", is not a string! It\'s been given as '.concat(typeof _.ifRightSideIncludesThisCropItToo,", equal to ").concat(c(_.ifRightSideIncludesThisCropItToo)));if(_.wipeAllWhitespaceOnLeft!==void 0&&typeof _.wipeAllWhitespaceOnLeft!="boolean")throw new Error('string-range-expander/expander(): [THROW_ID_14] The option "wipeAllWhitespaceOnLeft" must be a Boolean! It was given as '.concat(typeof _.wipeAllWhitespaceOnLeft,", equal to ").concat(c(_.wipeAllWhitespaceOnLeft)));if(_.wipeAllWhitespaceOnRight!==void 0&&typeof _.wipeAllWhitespaceOnRight!="boolean")throw new Error('string-range-expander/expander(): [THROW_ID_15] The option "wipeAllWhitespaceOnRight" must be a Boolean! It was given as '.concat(typeof _.wipeAllWhitespaceOnRight,", equal to ").concat(c(_.wipeAllWhitespaceOnRight)));if(_.addSingleSpaceToPreventAccidentalConcatenation!==void 0&&typeof _.addSingleSpaceToPreventAccidentalConcatenation!="boolean")throw new Error('string-range-expander/expander(): [THROW_ID_16] The option "addSingleSpaceToPreventAccidentalConcatenation" must be a Boolean! It was given as '.concat(typeof _.addSingleSpaceToPreventAccidentalConcatenation,", equal to ").concat(c(_.addSingleSpaceToPreventAccidentalConcatenation)));let e=L(C(C({},p),_),{ifLeftSideIncludesThisThenCropTightly:(f=_.ifLeftSideIncludesThisThenCropTightly)!=null?f:p.ifLeftSideIncludesThisThenCropTightly,ifLeftSideIncludesThisCropItToo:(g=_.ifLeftSideIncludesThisCropItToo)!=null?g:p.ifLeftSideIncludesThisCropItToo,ifRightSideIncludesThisThenCropTightly:(y=_.ifRightSideIncludesThisThenCropTightly)!=null?y:p.ifRightSideIncludesThisThenCropTightly,ifRightSideIncludesThisCropItToo:(d=_.ifRightSideIncludesThisCropItToo)!=null?d:p.ifRightSideIncludesThisCropItToo,extendToOneSide:(v=_.extendToOneSide)!=null?v:p.extendToOneSide,wipeAllWhitespaceOnLeft:(S=_.wipeAllWhitespaceOnLeft)!=null?S:p.wipeAllWhitespaceOnLeft,wipeAllWhitespaceOnRight:(O=_.wipeAllWhitespaceOnRight)!=null?O:p.wipeAllWhitespaceOnRight,addSingleSpaceToPreventAccidentalConcatenation:(w=_.addSingleSpaceToPreventAccidentalConcatenation)!=null?w:p.addSingleSpaceToPreventAccidentalConcatenation}),t=e.str,i=e.from,o=e.to;if(e.extendToOneSide!=="right"&&(n(t[i-1])&&(n(t[i-2])||u(e.ifLeftSideIncludesThisCropItToo,t,i-2))||t[i-1]&&u(e.ifLeftSideIncludesThisCropItToo,t,i-1)||e.wipeAllWhitespaceOnLeft&&n(t[i-1]))){for(let l=i;l--;)if(!u(e.ifLeftSideIncludesThisCropItToo,t,l)){if(t[l].trim()){e.wipeAllWhitespaceOnLeft||u(e.ifLeftSideIncludesThisCropItToo,t,l+1)?i=l+1:i=l+2;break}else if(l===0){e.wipeAllWhitespaceOnLeft?i=0:i=1;break}}}if(e.extendToOneSide!=="left"&&(n(t[o])&&(e.wipeAllWhitespaceOnRight||n(t[o+1])||u(e.ifRightSideIncludesThisCropItToo,t,o+1))||u(e.ifRightSideIncludesThisCropItToo,t,o))){for(let l=o,a=t.length;l<a;l++)if(!u(e.ifRightSideIncludesThisCropItToo,t,l)){if(t[l].trim()){e.wipeAllWhitespaceOnRight||u(e.ifRightSideIncludesThisCropItToo,t,l-1)?o=l:o=l-1;break}else if(l===t.length-1){e.wipeAllWhitespaceOnRight?o=t.length:o=t.length-1;break}}}return(e.extendToOneSide!=="right"&&m(e.ifLeftSideIncludesThisThenCropTightly)&&e.ifLeftSideIncludesThisThenCropTightly&&(t[i-2]&&u(e.ifLeftSideIncludesThisThenCropTightly,t,i-2)||t[i-1]&&u(e.ifLeftSideIncludesThisThenCropTightly,t,i-1))||e.extendToOneSide!=="left"&&m(e.ifRightSideIncludesThisThenCropTightly)&&e.ifRightSideIncludesThisThenCropTightly&&(t[o+1]&&u(e.ifRightSideIncludesThisThenCropTightly,t,o+1)||t[o]&&u(e.ifRightSideIncludesThisThenCropTightly,t,o)))&&(e.extendToOneSide!=="right"&&n(t[i-1])&&!e.wipeAllWhitespaceOnLeft&&(i-=1),e.extendToOneSide!=="left"&&n(t[o])&&!e.wipeAllWhitespaceOnRight&&(o+=1)),e.addSingleSpaceToPreventAccidentalConcatenation&&((r=t[i-1])!=null&&r.trim())&&((s=t[o])!=null&&s.trim())&&(!e.ifLeftSideIncludesThisThenCropTightly&&!e.ifRightSideIncludesThisThenCropTightly||!((!e.ifLeftSideIncludesThisThenCropTightly||u(e.ifLeftSideIncludesThisThenCropTightly,t,i-1))&&(!e.ifRightSideIncludesThisThenCropTightly||t[o]&&u(e.ifRightSideIncludesThisThenCropTightly,t,o))))&&(Q(t,i-1)||Q(t,o))?[i,o," "]:[i,o]}return t_(d_);})();
11
+ /**
12
+ * @name codsen-format-diagnostic-value
13
+ * @fileoverview Safely format untrusted JavaScript values for diagnostics
14
+ * @version 1.1.0
15
+ * @author Roy Revelt
16
+ * @license MIT
17
+ * {@link https://codsen.com/os/codsen-format-diagnostic-value/}
18
+ */
11
19
  /**
12
20
  * @name codsen-utils
13
21
  * @fileoverview Various utility functions
14
- * @version 1.8.0
22
+ * @version 1.10.0
15
23
  * @author Roy Revelt
16
24
  * @license MIT
17
25
  * {@link https://codsen.com/os/codsen-utils/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "string-range-expander",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "Expands string index ranges within whitespace boundaries until letters are met",
5
5
  "keywords": [
6
6
  "expand",
@@ -68,7 +68,7 @@
68
68
  }
69
69
  },
70
70
  "dependencies": {
71
- "codsen-utils": "^1.8.0"
71
+ "codsen-utils": "^1.10.0"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=18.20.8"
package/types/index.d.ts CHANGED
@@ -7,17 +7,18 @@ interface Opts {
7
7
  str: string;
8
8
  from: number;
9
9
  to: number;
10
- ifLeftSideIncludesThisThenCropTightly: string;
11
- ifLeftSideIncludesThisCropItToo: string;
12
- ifRightSideIncludesThisThenCropTightly: string;
13
- ifRightSideIncludesThisCropItToo: string;
14
- extendToOneSide: false | "left" | "right";
15
- wipeAllWhitespaceOnLeft: boolean;
16
- wipeAllWhitespaceOnRight: boolean;
17
- addSingleSpaceToPreventAccidentalConcatenation: boolean;
10
+ ifLeftSideIncludesThisThenCropTightly?: string;
11
+ ifLeftSideIncludesThisCropItToo?: string;
12
+ ifRightSideIncludesThisThenCropTightly?: string;
13
+ ifRightSideIncludesThisCropItToo?: string;
14
+ extendToOneSide?: false | "left" | "right";
15
+ wipeAllWhitespaceOnLeft?: boolean;
16
+ wipeAllWhitespaceOnRight?: boolean;
17
+ addSingleSpaceToPreventAccidentalConcatenation?: boolean;
18
18
  }
19
- declare const defaults: Opts;
20
- declare function expander(opts: Partial<Opts>): Range;
19
+ type ResolvedOpts = Required<Opts>;
20
+ declare const defaults: ResolvedOpts;
21
+ declare function expander(opts: Opts): Range;
21
22
 
22
23
  export { defaults, expander, version };
23
24
  export type { Opts, Range };