ranges-process-outside 6.2.1 → 6.2.3

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,18 @@
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
+ ## 6.2.2 (2026-08-22)
7
+
8
+ ### Performance Improvements
9
+
10
+ - optimise package hot paths and JSON editing ([f3112bd](https://github.com/codsen/codsen/commit/f3112bd7fc0d7c9bc09312d3744c950691d72ca5))
11
+
6
12
  ## 6.2.0 (2026-08-19)
7
13
 
8
14
  ### Bug Fixes
9
15
 
10
16
  - 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))
17
+ - resolve various review findings ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
12
18
  - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
19
 
14
20
  ### Features
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @name ranges-process-outside
3
3
  * @fileoverview Iterate string considering ranges, as if they were already applied
4
- * @version 6.2.1
4
+ * @version 6.2.3
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-process-outside/}
8
8
  */
9
9
 
10
- import{formatDiagnosticValue as c}from"codsen-utils";import{rCrop as y}from"ranges-crop";import{rInvert as $}from"ranges-invert";var a="6.2.1";var I=a;function D(e,t,r,m=!1){if(typeof e!="string")throw e===void 0?new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_01] the first input argument must be string! It's missing currently (undefined)!"):new Error(`ranges-process-outside/rProcessOutside(): [THROW_ID_02] the first input argument must be string! It was given as:
10
+ import{formatDiagnosticValue as c}from"codsen-utils";import{rCrop as y}from"ranges-crop";import{rInvert as $}from"ranges-invert";var a="6.2.3";var I=a;function D(e,t,r,m=!1){if(typeof e!="string")throw e===void 0?new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_01] the first input argument must be string! It's missing currently (undefined)!"):new Error(`ranges-process-outside/rProcessOutside(): [THROW_ID_02] the first input argument must be string! It was given as:
11
11
  ${c(e,4)} (type ${typeof e})`);if(t!=null&&(!Array.isArray(t)||t.length&&!Array.isArray(t[0])))throw new Error(`ranges-process-outside/rProcessOutside(): [THROW_ID_03] the second input argument must be array of ranges or null! It was given as:
12
12
  ${c(t,4)} (type ${typeof t})`);if(typeof r!="function")throw new Error(`ranges-process-outside/rProcessOutside(): [THROW_ID_04] the third input argument must be a function! It was given as:
13
13
  ${c(r,4)} (type ${typeof r})`);function p(o,f){let l=new Uint32Array(o.length),u=0;for(let n of o)l[u]=n.length,u+=n.length;(f||[]).forEach(([n,g])=>{for(let s=n;s<g;s++){let i=l[s]||1;r(s,s+i,d=>{d!=null&&(s+=d)}),i&&i>1&&(s+=i-1)}})}if(t?.length){let o=y($(t,e.length,{skipChecks:!!m}),e.length);p(e,o)}else p(e,[[0,e.length]])}export{D as rProcessOutside,I as version};
@@ -1,17 +1,25 @@
1
1
  /**
2
2
  * @name ranges-process-outside
3
3
  * @fileoverview Iterate string considering ranges, as if they were already applied
4
- * @version 6.2.1
4
+ * @version 6.2.3
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-process-outside/}
8
8
  */
9
9
 
10
- "use strict";var rangesProcessOutside=(()=>{var $=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames,D=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var R=(e,n,t)=>n in e?$(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,m=(e,n)=>{for(var t in n||(n={}))E.call(n,t)&&R(e,t,n[t]);if(D)for(var t of D(n))F.call(n,t)&&R(e,t,n[t]);return e};var N=(e,n)=>{for(var t in n)$(e,t,{get:n[t],enumerable:!0})},H=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let u of M(n))!E.call(e,u)&&u!==t&&$(e,u,{get:()=>n[u],enumerable:!(r=j(n,u))||r.enumerable});return e};var V=e=>H($({},"__esModule",{value:!0}),e);var J={};N(J,{rProcessOutside:()=>G,version:()=>z});function B(){let e=[],n=0,t=!1;return{append(r){return t?!1:n+r.length>1999?(e.push("\u2026"),n+=1,t=!0,!1):(e.push(r),n+=r.length,!0)},result(){return e.join("")},stopped(){return t}}}function L(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function T(e,n){if(e.append('"')){for(let t=0;t<n.length&&!e.stopped();t+=1){let r=n.charCodeAt(t);r===34?e.append('\\"'):r===92?e.append("\\\\"):r===8?e.append("\\b"):r===9?e.append("\\t"):r===10?e.append("\\n"):r===12?e.append("\\f"):r===13?e.append("\\r"):r<32||r===8232||r===8233||r>=55296&&r<=57343?e.append(L(r)):e.append(n[t])}e.append('"')}}function P(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function W(e,n){e.append("Symbol(");let t=String(n);t.length>8&&T(e,t.slice(7,-1)),e.append(")")}function k(e,n){typeof n=="symbol"?W(e,n):T(e,String(n))}function f(e,n=0){let t=B(),r=n===4?4:0,u=new WeakSet,o=0;function c(l){r&&t.append(" ".repeat(l*r))}function i(l,p){l&&t.append(","),r&&(t.append("\n"),c(p+1))}function a(l,p,g){r&&p&&(t.append("\n"),c(g)),t.append(l)}function s(l,p){Object.prototype.hasOwnProperty.call(l,"value")?A(l.value,p):t.append(P(l))}function C(l,p){let g;try{g=Reflect.getOwnPropertyDescriptor(l,"length")}catch(d){t.append("[Uninspectable]");return}let h=g==null?void 0:g.value;if(!Number.isSafeInteger(h)||h<0){t.append("[Uninspectable]");return}t.append("[");let b=!1;for(let d=0;d<h&&!t.stopped();d+=1){if(i(b,p),b=!0,o>=50){t.append("[MaxEntries]");break}o+=1;let v;try{v=Reflect.getOwnPropertyDescriptor(l,String(d))}catch(K){t.append("[Uninspectable]");continue}v!=null&&v.enumerable?s(v,p+1):t.append("[Empty]")}a("]",b,p)}function y(l,p){let g;try{g=Reflect.ownKeys(l)}catch(b){t.append("[Uninspectable]");return}t.append("{");let h=!1;for(let b of g){if(t.stopped())break;if(o>=50){i(h,p),h=!0,T(t,"\u2026"),t.append(r?": ":":"),t.append("[MaxEntries]");break}o+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(l,b)}catch(v){i(h,p),h=!0,k(t,b),t.append(r?": ":":"),t.append("[Uninspectable]");continue}d!=null&&d.enumerable&&(i(h,p),h=!0,k(t,b),t.append(r?": ":":"),s(d,p+1))}a("}",h,p)}function w(l,p){if(u.has(l)){t.append("[Circular]");return}if(p>=5){t.append("[MaxDepth]");return}let g;try{g=Array.isArray(l)}catch(h){t.append("[Uninspectable]");return}u.add(l);try{g?C(l,p):y(l,p)}finally{u.delete(l)}}function A(l,p){l===null?t.append("null"):typeof l=="string"?T(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"?W(t,l):typeof l=="function"?t.append("[Function]"):w(l,p)}try{return A(e,0),t.result()}catch(l){return"[Uninspectable]"}}var ee=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 U={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function x(e,n){if(!Array.isArray(e)||!e.length)return e;let t=m(m({},U),n),r,u;if(t.strictlyTwoElementsInRangeArrays&&!e.every((i,a)=>!Array.isArray(i)||i.length!==2?(r=a,u=i.length,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(r,"th range (").concat(f(e[r],4),") has not two but ").concat(u," elements!"));if(!e.every((i,a)=>!Array.isArray(i)||!Number.isInteger(i[0])||i[0]<0||!Number.isInteger(i[1])||i[1]<0?(r=a,!1):!0))throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(r,"th range (").concat(f(e[r],4),") does not consist of only natural numbers!"));let o=e.length**2,c=0;return Array.from(e).sort((i,a)=>(t.progressFn&&(c+=1,t.progressFn(Math.floor(c*100/o))),i[0]===a[0]?i[1]<a[1]?-1:i[1]>a[1]?1:0:i[0]<a[0]?-1:1))}var q={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function I(e,n){function t(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;if(n&&!t(n))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(f(n,4)," (type ").concat(typeof n,")"));let r=m(m({},q),n);if(r.progressFn&&t(r.progressFn)&&!Object.keys(r.progressFn).length)r.progressFn=null;else if(r.progressFn&&typeof r.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof r.progressFn,'", equal to ').concat(f(r.progressFn,4)));if(![1,2,"1","2"].includes(r.mergeType))throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(f(r.mergeType,4)));if(typeof r.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof r.joinRangesThatTouchEdges,'", equal to ').concat(f(r.joinRangesThatTouchEdges,4)));let u=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,c,i;r.progressFn?o=x(u,{progressFn:s=>{i=Math.floor(s/5),i!==c&&(c=i,r.progressFn(i))}}):o=x(u);let a=o.length-1;for(let s=a;s>0;s--)r.progressFn&&(i=Math.floor((1-s/a)*78)+21,i!==c&&i>c&&(c=i,r.progressFn(i))),(o[s][0]<=o[s-1][0]||!r.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||r.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+r.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}function O(e,n){if(e===null)return null;if(!Array.isArray(e))throw new TypeError("ranges-crop/rCrop(): [THROW_ID_01] The first input's argument must be an array, consisting of range arrays! Currently its type is: ".concat(typeof e,", equal to: ").concat(f(e,4)));if(!Number.isInteger(n)||n<0)throw new TypeError("ranges-crop/rCrop(): [THROW_ID_02] The second input's argument must be a natural number or zero (coming from String.length)! Currently its type is: ".concat(typeof n,", equal to: ").concat(f(n,4)));if(!e.some(Boolean))return[];if(typeof e[0]=="number"&&typeof e[1]=="number")throw new TypeError("ranges-crop/rCrop(): [THROW_ID_03] The first argument should be AN ARRAY OF RANGES, not a single range! Currently arrOfRanges = ".concat(f(e),"!"));for(let r=0;r<e.length;r++){let u=e[r];if(u){if(!Array.isArray(u)||!Number.isInteger(u[0])||u[0]<0||!Number.isInteger(u[1])||u[1]<0)throw new TypeError("ranges-crop/rCrop(): [THROW_ID_04] The first argument should be AN ARRAY OF ARRAYS! Each sub-array means string slice indexes. In our case, here ".concat(r,"th range (").concat(f(u),") does not consist of only natural numbers!"));if(u[2]!=null&&typeof u[2]!="string")throw new TypeError("ranges-crop/rCrop(): [THROW_ID_05] The third argument, if present at all, should be of a string-type or null. Currently the ".concat(r,"th range ").concat(f(u)," has a argument in the range of a type ").concat(typeof u[2]))}}let t=(I(e)||[]).filter(r=>r[0]<=n&&(r[2]!=null||r[0]<n)).map(r=>r[1]>n?r[2]!=null?[r[0],n,r[2]]:[r[0],n]:r);return t.length?t:null}var Y={strictlyTwoElementsInRangeArrays:!1,skipChecks:!1};function S(e,n,t){if(!Array.isArray(e)&&e!==null)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_01] Input's first argument must be an array, consisting of range arrays! Currently its type is: ".concat(typeof e,", equal to: ").concat(f(e,4)));if(!Number.isInteger(n)||n<0)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_02] Input's second argument must be a natural number or zero (coming from String.length)! Currently its type is: ".concat(typeof n,", equal to: ").concat(f(n,4)));if(Array.isArray(e)&&typeof e[0]=="number"&&typeof e[1]=="number")throw new TypeError("ranges-invert/rInvert(): [THROW_ID_03] The first argument should be AN ARRAY OF RANGES, not a single range! Currently arrOfRanges = ".concat(f(e),"!"));if(!Array.isArray(e)||!n)return n?[[0,n]]:null;let r=m(m({},Y),t),u=[];for(let i=0;i<e.length;i++){let a=e[i];if(a){if(!r.skipChecks){if(r.strictlyTwoElementsInRangeArrays&&(!Array.isArray(a)||a.length!==2))throw new TypeError("ranges-invert/rInvert(): [THROW_ID_04] Because opts.strictlyTwoElementsInRangeArrays was enabled, all ranges must be strictly two-element-long. However, the ".concat(i,"th range (").concat(f(a),") has not two but ").concat(a.length," elements!"));if(!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_05] The first argument should be AN ARRAY OF ARRAYS! Each sub-array means string slice indexes. In our case, here ".concat(i+1,"th range (").concat(f(a),") does not consist of only natural numbers!"))}Array.isArray(a)&&a[0]!==a[1]&&u.push(a)}}if(!u.length)return[[0,n]];let o;r.skipChecks?o=u:o=I(u);let c=[];for(let i=0;i<o.length;i++){let a=o[i];i===0&&o[0][0]!==0&&c.push([0,o[0][0]]);let s=i<o.length-1?o[i+1][0]:n;if(a[1]!==s){if(r.skipChecks&&a[1]>s)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_06] The checking (opts.skipChecks) is off and input ranges were not sorted! We nearly wrote range [".concat(a[1],", ").concat(s,"] which is backwards. For investigation, whole ranges array is:\n").concat(f(o)));c.push([a[1],s])}}return O(c,n)}var _="6.2.1";var z=_;function G(e,n,t,r=!1){if(typeof e!="string")throw e===void 0?new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_01] the first input argument must be string! It's missing currently (undefined)!"):new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_02] the first input argument must be string! It was given as:\n".concat(f(e,4)," (type ").concat(typeof e,")"));if(n!=null&&(!Array.isArray(n)||n.length&&!Array.isArray(n[0])))throw new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_03] the second input argument must be array of ranges or null! It was given as:\n".concat(f(n,4)," (type ").concat(typeof n,")"));if(typeof t!="function")throw new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_04] the third input argument must be a function! It was given as:\n".concat(f(t,4)," (type ").concat(typeof t,")"));function u(o,c){let i=new Uint32Array(o.length),a=0;for(let s of o)i[a]=s.length,a+=s.length;(c||[]).forEach(([s,C])=>{for(let y=s;y<C;y++){let w=i[y]||1;t(y,y+w,A=>{A!=null&&(y+=A)}),w&&w>1&&(y+=w-1)}})}if(n!=null&&n.length){let o=O(S(n,e.length,{skipChecks:!!r}),e.length);u(e,o)}else u(e,[[0,e.length]])}return V(J);})();
10
+ "use strict";var rangesProcessOutside=(()=>{var $=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames,D=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var R=(e,r,t)=>r in e?$(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,A=(e,r)=>{for(var t in r||(r={}))C.call(r,t)&&R(e,t,r[t]);if(D)for(var t of D(r))U.call(r,t)&&R(e,t,r[t]);return e};var Y=(e,r)=>{for(var t in r)$(e,t,{get:r[t],enumerable:!0})},G=(e,r,t,_)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of q(r))!C.call(e,s)&&s!==t&&$(e,s,{get:()=>r[s],enumerable:!(_=z(r,s))||_.enumerable});return e};var J=e=>G($({},"__esModule",{value:!0}),e);var le={};Y(le,{rProcessOutside:()=>ie,version:()=>se});function K(){let e=[],r=0,t=!1;return{append(_){return t?!1:r+_.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(_),r+=_.length,!0)},result(){return e.join("")},stopped(){return t}}}function Q(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function T(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let _=r.charCodeAt(t);_===34?e.append('\\"'):_===92?e.append("\\\\"):_===8?e.append("\\b"):_===9?e.append("\\t"):_===10?e.append("\\n"):_===12?e.append("\\f"):_===13?e.append("\\r"):_<32||_===8232||_===8233||_>=55296&&_<=57343?e.append(Q(_)):e.append(r[t])}e.append('"')}}function Z(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function S(e,r){e.append("Symbol(");let t=String(r);t.length>8&&T(e,t.slice(7,-1)),e.append(")")}function E(e,r){typeof r=="symbol"?S(e,r):T(e,String(r))}function f(e,r=0){let t=K(),_=r===4?4:0,s=new WeakSet,l=0;function c(o){_&&t.append(" ".repeat(o*_))}function a(o,u){o&&t.append(","),_&&(t.append("\n"),c(u+1))}function n(o,u,h){_&&u&&(t.append("\n"),c(h)),t.append(o)}function i(o,u){Object.prototype.hasOwnProperty.call(o,"value")?g(o.value,u):t.append(Z(o))}function b(o,u){let h;try{h=Reflect.getOwnPropertyDescriptor(o,"length")}catch(m){t.append("[Uninspectable]");return}let d=h==null?void 0:h.value;if(!Number.isSafeInteger(d)||d<0){t.append("[Uninspectable]");return}t.append("[");let w=!1;for(let m=0;m<d&&!t.stopped();m+=1){if(a(w,u),w=!0,l>=50){t.append("[MaxEntries]");break}l+=1;let v;try{v=Reflect.getOwnPropertyDescriptor(o,String(m))}catch(ae){t.append("[Uninspectable]");continue}v!=null&&v.enumerable?i(v,u+1):t.append("[Empty]")}n("]",w,u)}function p(o,u){let h;try{h=Reflect.ownKeys(o)}catch(w){t.append("[Uninspectable]");return}t.append("{");let d=!1;for(let w of h){if(t.stopped())break;if(l>=50){a(d,u),d=!0,T(t,"\u2026"),t.append(_?": ":":"),t.append("[MaxEntries]");break}l+=1;let m;try{m=Reflect.getOwnPropertyDescriptor(o,w)}catch(v){a(d,u),d=!0,E(t,w),t.append(_?": ":":"),t.append("[Uninspectable]");continue}m!=null&&m.enumerable&&(a(d,u),d=!0,E(t,w),t.append(_?": ":":"),i(m,u+1))}n("}",d,u)}function y(o,u){if(s.has(o)){t.append("[Circular]");return}if(u>=5){t.append("[MaxDepth]");return}let h;try{h=Array.isArray(o)}catch(d){t.append("[Uninspectable]");return}s.add(o);try{h?b(o,u):p(o,u)}finally{s.delete(o)}}function g(o,u){o===null?t.append("null"):typeof o=="string"?T(t,o):typeof o=="number"?t.append(Object.is(o,-0)?"-0":String(o)):typeof o=="boolean"?t.append(o?"true":"false"):typeof o>"u"?t.append("undefined"):typeof o=="bigint"?t.append("".concat(o,"n")):typeof o=="symbol"?S(t,o):typeof o=="function"?t.append("[Function]"):y(o,u)}try{return g(e,0),t.result()}catch(o){return"[Uninspectable]"}}var X=["_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_8_4l_1_11_2_0_","6_14_1z_q_4_3_19_16_z_1_1_2q_1_0_f_1_7_1_a_2_2_0_g_0_1_t_t_2g_b_0_o_w_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_f_f_4_7_2_1_2_l_1_6_1_0_3_3_3_0_g_0_d_1_1_2_e_1_a_0_8_5_4_1_2_l_1_6","_1_1_1_1_1_1_v_3_1_0_j_2_g_8_1_2_1_l_1_6_1_1_1_4_3_0_i_0_f_1_n_0_b_7_2_1_2_l_1_6_1_1_1_4_3_0_u_1_1_2","_f_0_h_0_1_5_3_2_1_3_3_1_1_0_1_1_3_1_3_2_3_b_m_0_1g_7_1_2_1_m_1_f_3_0_q_2_1_1_2_1_u_0_4_7_1_2_1_m_1_","9_1_4_3_0_u_2_1_1_f_1_h_8_1_2_1_14_2_0_g_0_5_2_8_2_o_5_5_h_3_n_1_8_1_0_2_6_1m_1b_1_1_c_6_1m_1_1_0_1_","4_1_n_1_0_1_9_1_1_9_0_2_4_1_0_l_3_w_0_1r_7_1_z_r_4_37_16_k_0_g_5_4_3_3_0_3_1_7_2_4_c_c_0_h_11_1_0_5_","0_2_16_1_98_1_3_2_6_1_0_1_3_2_14_1_3_2_w_1_3_2_6_1_0_1_3_2_e_1_1k_1_3_2_1u_11_f_g_2d_2_5_3_h7_2_g_1_","p_5_22_6_7_7_h_d_i_e_h_e_c_1_2_f_1f_z_0_4_0_1v_2g_7_4_2_x_1_0_5_1x_a_u_1d_t_2_4_b_17_4_p_1i_m_9_1g_2","a_0_2l_1a_h_7_1i_t_d_1_a_17_q_z_15_2_a_z_2_a_5_16_2_2_15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r+Number.parseInt(j[e+1],36);ee.push([r,t]),W=t}var ge=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 H=Function.prototype.toString,te=H.call(Object);var he=Map.prototype.entries,de=Set.prototype.values;var F,ye=(F=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength"))==null?void 0:F.get,M,me=(M=Object.getOwnPropertyDescriptor(RegExp.prototype,"flags"))==null?void 0:M.get,N,be=(N=Object.getOwnPropertyDescriptor(RegExp.prototype,"global"))==null?void 0:N.get,P,we=(P=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:P.get,ve=RegExp.prototype.test;function O(e){var _;if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);if(r===null||r===Object.prototype)return!0;let t=Object.getOwnPropertyDescriptor(r,"constructor");return!t||!("value"in t)||typeof t.value!="function"?!1:((_=Object.getOwnPropertyDescriptor(t.value,"prototype"))==null?void 0:_.value)===r&&H.call(t.value)===te}var Ae=Date.prototype.getTime;var V={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function re(e,r){let t,_=0;for(;_<e.length;){let s=_+1;for(;s<e.length&&e[_][0]===e[s][0]&&e[_][1]===e[s][1];)s+=1;if(s-_>1){t||(t=new Map(r.map((a,n)=>[a,n])));let l=t,c=e.slice(_,s).sort((a,n)=>l.get(a)-l.get(n));e.splice(_,c.length,...c)}_=s}return e}function k(e,r){var a;if(!Array.isArray(e)||!e.length)return e;let t=r===void 0?!0:O(r);if(r!==void 0&&t&&(r==null?void 0:r.strictlyTwoElementsInRangeArrays)===!0)for(let n=0;n<e.length;n+=1){let i=e[n];if(!Array.isArray(i)||i.length!==2)throw new TypeError("ranges-sort/rSort(): [THROW_ID_01] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, range at index ".concat(n," (").concat(f(i,4),") is ").concat(Array.isArray(i)?"an array with ".concat(i.length," elements"):"not an array","!"));if(!Number.isInteger(i[0])||i[0]<0||!Number.isInteger(i[1])||i[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(n," (").concat(f(i,4),") does not consist of only natural numbers!"))}else for(let n=0;n<e.length;n+=1){let i=e[n];if(!Array.isArray(i)||!Number.isInteger(i[0])||i[0]<0||!Number.isInteger(i[1])||i[1]<0)throw new TypeError("ranges-sort/rSort(): [THROW_ID_02] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, range at index ".concat(n," (").concat(f(i,4),") does not consist of only natural numbers!"))}if(r!==void 0&&!t)throw new TypeError("ranges-sort/rSort(): [THROW_ID_03] The second argument must be a plain options object; received ".concat(f(r,4)," (type ").concat(typeof r,")!"));let _=V.progressFn;if(r!==void 0){let n=r.strictlyTwoElementsInRangeArrays;if(n!==void 0&&typeof n!="boolean")throw new TypeError("ranges-sort/rSort(): [THROW_ID_04] opts.strictlyTwoElementsInRangeArrays must be a boolean; received ".concat(f(n,4)," (type ").concat(typeof n,")!"));if(_=(a=r.progressFn)!=null?a:V.progressFn,_!==!1&&_!==null&&typeof _!="function")throw new TypeError("ranges-sort/rSort(): [THROW_ID_05] opts.progressFn must be a function, false, null, or undefined; received ".concat(f(_,4)," (type ").concat(typeof _,")!"))}let s,l;if(_){let n=e.length**2,i=0,b;l=p=>{p!==b&&(b=p,_(p))},s=Array.from(e).sort((p,y)=>(i+=1,l==null||l(Math.min(99,Math.floor(i*100/n))),p[0]===y[0]?p[1]<y[1]?-1:p[1]>y[1]?1:0:p[0]<y[0]?-1:1))}else s=Array.from(e).sort((n,i)=>n[0]===i[0]?n[1]<i[1]?-1:n[1]>i[1]?1:0:n[0]<i[0]?-1:1);let c=s.length>10?re(s,e):s;return l==null||l(100),c}var _e={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function I(e,r){if(!Array.isArray(e)||!e.length)return null;if(r!==void 0&&!O(r))throw new TypeError("ranges-merge/rMerge(): [THROW_ID_01] the second input argument must be a plain object. It was given as:\n".concat(f(r,4)," (type ").concat(typeof r,")"));let t=A(A({},_e),r);if(t.progressFn&&O(t.progressFn)&&!Object.keys(t.progressFn).length)t.progressFn=null;else if(t.progressFn&&typeof t.progressFn!="function")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_02] opts.progressFn must be a function! It was given of a type: "'.concat(typeof t.progressFn,'", equal to ').concat(f(t.progressFn,4)));if(t.mergeType!==1&&t.mergeType!==2&&t.mergeType!=="1"&&t.mergeType!=="2")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_03] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof t.mergeType,'", equal to ').concat(f(t.mergeType,4)));if(typeof t.joinRangesThatTouchEdges!="boolean")throw new TypeError('ranges-merge/rMerge(): [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof t.joinRangesThatTouchEdges,'", equal to ').concat(f(t.joinRangesThatTouchEdges,4)));let _=t.progressFn,s=t.joinRangesThatTouchEdges,l=[];for(let g of e)Array.isArray(g)&&(g[2]!==void 0||g[0]!==g[1])&&l.push([...g]);let c,a,n;_?c=k(l,{progressFn:g=>{n=Math.floor(g/5),n!==a&&(a=n,_(n))}}):c=k(l);let i=c.length-1,b=t.mergeType===2||t.mergeType==="2",p=c.length;for(let g=i;g>=0;g--){let o=c[g];for(_&&g<i&&(n=Math.floor((1-(g+1)/i)*78)+21,n!==a&&n>a&&(a=n,_(n)));p<c.length;){let u=c[p],h=u[0]===o[0];if(!h&&(s?u[0]>o[1]:u[0]>=o[1]))break;let d=u[1]>=o[1];d&&(o[1]=u[1]),u[2]===null?o[2]=null:u[2]!==void 0&&(h||d)&&o[2]!==null&&(o[2]!=null?b&&h?o[2]=u[2]:o[2]+=u[2]:o[2]=u[2]),p+=1}p-=1,c[p]=o}let y=c.length-p;for(let g=0;g<y;g++)c[g]=c[p+g];return c.length=y,_&&a!==99&&_(99),c.length?c:null}function x(e,r){if(e===null)return null;if(!Array.isArray(e))throw new TypeError("ranges-crop/rCrop(): [THROW_ID_01] The first input's argument must be an array, consisting of range arrays! Currently its type is: ".concat(typeof e,", equal to: ").concat(f(e,4)));if(!Number.isInteger(r)||r<0)throw new TypeError("ranges-crop/rCrop(): [THROW_ID_02] The second input's argument must be a natural number or zero (coming from String.length)! Currently its type is: ".concat(typeof r,", equal to: ").concat(f(r,4)));if(!e.some(Boolean))return[];if(typeof e[0]=="number"&&typeof e[1]=="number")throw new TypeError("ranges-crop/rCrop(): [THROW_ID_03] The first argument should be AN ARRAY OF RANGES, not a single range! Currently arrOfRanges = ".concat(f(e),"!"));for(let _=0;_<e.length;_++){let s=e[_];if(s){if(!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0)throw new TypeError("ranges-crop/rCrop(): [THROW_ID_04] The first argument should be AN ARRAY OF ARRAYS! Each sub-array means string slice indexes. In our case, here ".concat(_,"th range (").concat(f(s),") does not consist of only natural numbers!"));if(s[2]!=null&&typeof s[2]!="string")throw new TypeError("ranges-crop/rCrop(): [THROW_ID_05] The third argument, if present at all, should be of a string-type or null. Currently the ".concat(_,"th range ").concat(f(s)," has a argument in the range of a type ").concat(typeof s[2]))}}let t=(I(e)||[]).filter(_=>_[0]<=r&&(_[2]!=null||_[0]<r)).map(_=>_[1]>r?_[2]!=null?[_[0],r,_[2]]:[_[0],r]:_);return t.length?t:null}var ne={strictlyTwoElementsInRangeArrays:!1,skipChecks:!1};function B(e,r,t){if(!Array.isArray(e)&&e!==null)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_01] Input's first argument must be an array, consisting of range arrays! Currently its type is: ".concat(typeof e,", equal to: ").concat(f(e,4)));if(!Number.isInteger(r)||r<0)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_02] Input's second argument must be a natural number or zero (coming from String.length)! Currently its type is: ".concat(typeof r,", equal to: ").concat(f(r,4)));if(Array.isArray(e)&&typeof e[0]=="number"&&typeof e[1]=="number")throw new TypeError("ranges-invert/rInvert(): [THROW_ID_03] The first argument should be AN ARRAY OF RANGES, not a single range! Currently arrOfRanges = ".concat(f(e),"!"));if(!Array.isArray(e)||!r)return r?[[0,r]]:null;let _=A(A({},ne),t),s=[];for(let a=0;a<e.length;a++){let n=e[a];if(n){if(!_.skipChecks){if(_.strictlyTwoElementsInRangeArrays&&(!Array.isArray(n)||n.length!==2))throw new TypeError("ranges-invert/rInvert(): [THROW_ID_04] Because opts.strictlyTwoElementsInRangeArrays was enabled, all ranges must be strictly two-element-long. However, the ".concat(a,"th range (").concat(f(n),") has not two but ").concat(n.length," elements!"));if(!Array.isArray(n)||!Number.isInteger(n[0])||n[0]<0||!Number.isInteger(n[1])||n[1]<0)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_05] The first argument should be AN ARRAY OF ARRAYS! Each sub-array means string slice indexes. In our case, here ".concat(a+1,"th range (").concat(f(n),") does not consist of only natural numbers!"))}Array.isArray(n)&&n[0]!==n[1]&&s.push(n)}}if(!s.length)return[[0,r]];let l;_.skipChecks?l=s:l=I(s);let c=[];for(let a=0;a<l.length;a++){let n=l[a];a===0&&l[0][0]!==0&&c.push([0,l[0][0]]);let i=a<l.length-1?l[a+1][0]:r;if(n[1]!==i){if(_.skipChecks&&n[1]>i)throw new TypeError("ranges-invert/rInvert(): [THROW_ID_06] The checking (opts.skipChecks) is off and input ranges were not sorted! We nearly wrote range [".concat(n[1],", ").concat(i,"] which is backwards. For investigation, whole ranges array is:\n").concat(f(l)));c.push([n[1],i])}}return x(c,r)}var L="6.2.3";var se=L;function ie(e,r,t,_=!1){if(typeof e!="string")throw e===void 0?new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_01] the first input argument must be string! It's missing currently (undefined)!"):new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_02] the first input argument must be string! It was given as:\n".concat(f(e,4)," (type ").concat(typeof e,")"));if(r!=null&&(!Array.isArray(r)||r.length&&!Array.isArray(r[0])))throw new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_03] the second input argument must be array of ranges or null! It was given as:\n".concat(f(r,4)," (type ").concat(typeof r,")"));if(typeof t!="function")throw new Error("ranges-process-outside/rProcessOutside(): [THROW_ID_04] the third input argument must be a function! It was given as:\n".concat(f(t,4)," (type ").concat(typeof t,")"));function s(l,c){let a=new Uint32Array(l.length),n=0;for(let i of l)a[n]=i.length,n+=i.length;(c||[]).forEach(([i,b])=>{for(let p=i;p<b;p++){let y=a[p]||1;t(p,p+y,g=>{g!=null&&(p+=g)}),y&&y>1&&(p+=y-1)}})}if(r!=null&&r.length){let l=x(B(r,e.length,{skipChecks:!!_}),e.length);s(e,l)}else s(e,[[0,e.length]])}return J(le);})();
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/}
@@ -19,7 +27,7 @@
19
27
  /**
20
28
  * @name ranges-sort
21
29
  * @fileoverview Sort string index ranges
22
- * @version 6.2.0
30
+ * @version 6.2.2
23
31
  * @author Roy Revelt
24
32
  * @license MIT
25
33
  * {@link https://codsen.com/os/ranges-sort/}
@@ -27,7 +35,7 @@
27
35
  /**
28
36
  * @name ranges-merge
29
37
  * @fileoverview Merge and sort string index ranges
30
- * @version 9.2.1
38
+ * @version 9.2.3
31
39
  * @author Roy Revelt
32
40
  * @license MIT
33
41
  * {@link https://codsen.com/os/ranges-merge/}
@@ -35,7 +43,7 @@
35
43
  /**
36
44
  * @name ranges-crop
37
45
  * @fileoverview Crop array of ranges when they go beyond the reference string's length
38
- * @version 6.2.1
46
+ * @version 6.2.3
39
47
  * @author Roy Revelt
40
48
  * @license MIT
41
49
  * {@link https://codsen.com/os/ranges-crop/}
@@ -43,7 +51,7 @@
43
51
  /**
44
52
  * @name ranges-invert
45
53
  * @fileoverview Invert string index ranges
46
- * @version 6.2.1
54
+ * @version 6.2.3
47
55
  * @author Roy Revelt
48
56
  * @license MIT
49
57
  * {@link https://codsen.com/os/ranges-invert/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ranges-process-outside",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "description": "Iterate string considering ranges, as if they were already applied",
5
5
  "keywords": ["array", "indexes", "ranges", "sort", "string"],
6
6
  "homepage": "https://codsen.com/os/ranges-process-outside",
@@ -55,9 +55,9 @@
55
55
  }
56
56
  },
57
57
  "dependencies": {
58
- "codsen-utils": "^1.8.0",
59
- "ranges-crop": "^6.2.1",
60
- "ranges-invert": "^6.2.1"
58
+ "codsen-utils": "^1.10.0",
59
+ "ranges-crop": "^6.2.3",
60
+ "ranges-invert": "^6.2.3"
61
61
  },
62
62
  "engines": {
63
63
  "node": ">=18.20.8"