ranges-sort 6.2.0 → 6.2.1

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.1 (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
  - standardise range sorting errs ([80ef071](https://github.com/codsen/codsen/commit/80ef07195b5e5baec63d295fa236f8610f9f954f))
14
20
 
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ranges-sort
3
3
  * @fileoverview Sort string index ranges
4
- * @version 6.2.0
4
+ * @version 6.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-sort/}
8
8
  */
9
9
 
10
- import{formatDiagnosticValue as u}from"codsen-utils";var l="6.2.0";var f=l,m={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function h(t,p){if(!Array.isArray(t)||!t.length)return t;let n={...m,...p},s,o;if(n.strictlyTwoElementsInRangeArrays&&!t.every((e,r)=>!Array.isArray(e)||e.length!==2?(s=r,o=e.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, ${s}th range (${u(t[s],4)}) has not two but ${o} elements!`);if(!t.every((e,r)=>!Array.isArray(e)||!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0?(s=r,!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, ${s}th range (${u(t[s],4)}) does not consist of only natural numbers!`);let c=t.length**2,i=0;return Array.from(t).sort((e,r)=>(n.progressFn&&(i+=1,n.progressFn(Math.floor(i*100/c))),e[0]===r[0]?e[1]<r[1]?-1:e[1]>r[1]?1:0:e[0]<r[0]?-1:1))}export{m as defaults,h as rSort,f as version};
10
+ import{formatDiagnosticValue as u}from"codsen-utils";var l="6.2.1";var f=l,m={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function h(t,p){if(!Array.isArray(t)||!t.length)return t;let n={...m,...p},s,o;if(n.strictlyTwoElementsInRangeArrays&&!t.every((e,r)=>!Array.isArray(e)||e.length!==2?(s=r,o=e.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, ${s}th range (${u(t[s],4)}) has not two but ${o} elements!`);if(!t.every((e,r)=>!Array.isArray(e)||!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0?(s=r,!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, ${s}th range (${u(t[s],4)}) does not consist of only natural numbers!`);let c=t.length**2,i=0;return Array.from(t).sort((e,r)=>(n.progressFn&&(i+=1,n.progressFn(Math.floor(i*100/c))),e[0]===r[0]?e[1]<r[1]?-1:e[1]>r[1]?1:0:e[0]<r[0]?-1:1))}export{m as defaults,h as rSort,f as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name ranges-sort
3
3
  * @fileoverview Sort string index ranges
4
- * @version 6.2.0
4
+ * @version 6.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-sort/}
8
8
  */
9
9
 
10
- "use strict";var rangesSort=(()=>{var m=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames,x=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var C=(t,n,e)=>n in t?m(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,b=(t,n)=>{for(var e in n||(n={}))S.call(n,e)&&C(t,e,n[e]);if(x)for(var e of x(n))T.call(n,e)&&C(t,e,n[e]);return t};var B=(t,n)=>{for(var e in n)m(t,e,{get:n[e],enumerable:!0})},F=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of R(n))!S.call(t,o)&&o!==e&&m(t,o,{get:()=>n[o],enumerable:!(i=M(n,o))||i.enumerable});return t};var L=t=>F(m({},"__esModule",{value:!0}),t);var V={};B(V,{defaults:()=>$,rSort:()=>_,version:()=>H});function P(){let t=[],n=0,e=!1;return{append(i){return e?!1:n+i.length>1999?(t.push("\u2026"),n+=1,e=!0,!1):(t.push(i),n+=i.length,!0)},result(){return t.join("")},stopped(){return e}}}function E(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function y(t,n){if(t.append('"')){for(let e=0;e<n.length&&!t.stopped();e+=1){let i=n.charCodeAt(e);i===34?t.append('\\"'):i===92?t.append("\\\\"):i===8?t.append("\\b"):i===9?t.append("\\t"):i===10?t.append("\\n"):i===12?t.append("\\f"):i===13?t.append("\\r"):i<32||i===8232||i===8233||i>=55296&&i<=57343?t.append(E(i)):t.append(n[e])}t.append('"')}}function N(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function O(t,n){t.append("Symbol(");let e=String(n);e.length>8&&y(t,e.slice(7,-1)),t.append(")")}function k(t,n){typeof n=="symbol"?O(t,n):y(t,String(n))}function v(t,n=0){let e=P(),i=n===4?4:0,o=new WeakSet,h=0;function g(r){i&&e.append(" ".repeat(r*i))}function l(r,s){r&&e.append(","),i&&(e.append("\n"),g(s+1))}function f(r,s,u){i&&s&&(e.append("\n"),g(u)),e.append(r)}function w(r,s){Object.prototype.hasOwnProperty.call(r,"value")?A(r.value,s):e.append(N(r))}function D(r,s){let u;try{u=Reflect.getOwnPropertyDescriptor(r,"length")}catch(c){e.append("[Uninspectable]");return}let a=u==null?void 0:u.value;if(!Number.isSafeInteger(a)||a<0){e.append("[Uninspectable]");return}e.append("[");let p=!1;for(let c=0;c<a&&!e.stopped();c+=1){if(l(p,s),p=!0,h>=50){e.append("[MaxEntries]");break}h+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(r,String(c))}catch(Q){e.append("[Uninspectable]");continue}d!=null&&d.enumerable?w(d,s+1):e.append("[Empty]")}f("]",p,s)}function I(r,s){let u;try{u=Reflect.ownKeys(r)}catch(p){e.append("[Uninspectable]");return}e.append("{");let a=!1;for(let p of u){if(e.stopped())break;if(h>=50){l(a,s),a=!0,y(e,"\u2026"),e.append(i?": ":":"),e.append("[MaxEntries]");break}h+=1;let c;try{c=Reflect.getOwnPropertyDescriptor(r,p)}catch(d){l(a,s),a=!0,k(e,p),e.append(i?": ":":"),e.append("[Uninspectable]");continue}c!=null&&c.enumerable&&(l(a,s),a=!0,k(e,p),e.append(i?": ":":"),w(c,s+1))}f("}",a,s)}function W(r,s){if(o.has(r)){e.append("[Circular]");return}if(s>=5){e.append("[MaxDepth]");return}let u;try{u=Array.isArray(r)}catch(a){e.append("[Uninspectable]");return}o.add(r);try{u?D(r,s):I(r,s)}finally{o.delete(r)}}function A(r,s){r===null?e.append("null"):typeof r=="string"?y(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"?O(e,r):typeof r=="function"?e.append("[Function]"):W(r,s)}try{return A(t,0),e.result()}catch(r){return"[Uninspectable]"}}var K=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 j="6.2.0";var H=j,$={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function _(t,n){if(!Array.isArray(t)||!t.length)return t;let e=b(b({},$),n),i,o;if(e.strictlyTwoElementsInRangeArrays&&!t.every((l,f)=>!Array.isArray(l)||l.length!==2?(i=f,o=l.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(i,"th range (").concat(v(t[i],4),") has not two but ").concat(o," elements!"));if(!t.every((l,f)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(i=f,!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(i,"th range (").concat(v(t[i],4),") does not consist of only natural numbers!"));let h=t.length**2,g=0;return Array.from(t).sort((l,f)=>(e.progressFn&&(g+=1,e.progressFn(Math.floor(g*100/h))),l[0]===f[0]?l[1]<f[1]?-1:l[1]>f[1]?1:0:l[0]<f[0]?-1:1))}return L(V);})();
10
+ "use strict";var rangesSort=(()=>{var y=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames,x=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var C=(t,n,e)=>n in t?y(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,b=(t,n)=>{for(var e in n||(n={}))S.call(n,e)&&C(t,e,n[e]);if(x)for(var e of x(n))B.call(n,e)&&C(t,e,n[e]);return t};var E=(t,n)=>{for(var e in n)y(t,e,{get:n[e],enumerable:!0})},P=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of M(n))!S.call(t,o)&&o!==e&&y(t,o,{get:()=>n[o],enumerable:!(i=T(n,o))||i.enumerable});return t};var F=t=>P(y({},"__esModule",{value:!0}),t);var Q={};E(Q,{defaults:()=>I,rSort:()=>V,version:()=>_});function L(){let t=[],n=0,e=!1;return{append(i){return e?!1:n+i.length>1999?(t.push("\u2026"),n+=1,e=!0,!1):(t.push(i),n+=i.length,!0)},result(){return t.join("")},stopped(){return e}}}function U(t){return"\\u".concat(t.toString(16).padStart(4,"0"))}function m(t,n){if(t.append('"')){for(let e=0;e<n.length&&!t.stopped();e+=1){let i=n.charCodeAt(e);i===34?t.append('\\"'):i===92?t.append("\\\\"):i===8?t.append("\\b"):i===9?t.append("\\t"):i===10?t.append("\\n"):i===12?t.append("\\f"):i===13?t.append("\\r"):i<32||i===8232||i===8233||i>=55296&&i<=57343?t.append(U(i)):t.append(n[e])}t.append('"')}}function N(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function j(t,n){t.append("Symbol(");let e=String(n);e.length>8&&m(t,e.slice(7,-1)),t.append(")")}function k(t,n){typeof n=="symbol"?j(t,n):m(t,String(n))}function v(t,n=0){let e=L(),i=n===4?4:0,o=new WeakSet,h=0;function g(r){i&&e.append(" ".repeat(r*i))}function l(r,s){r&&e.append(","),i&&(e.append("\n"),g(s+1))}function f(r,s,u){i&&s&&(e.append("\n"),g(u)),e.append(r)}function A(r,s){Object.prototype.hasOwnProperty.call(r,"value")?w(r.value,s):e.append(N(r))}function $(r,s){let u;try{u=Reflect.getOwnPropertyDescriptor(r,"length")}catch(c){e.append("[Uninspectable]");return}let a=u==null?void 0:u.value;if(!Number.isSafeInteger(a)||a<0){e.append("[Uninspectable]");return}e.append("[");let p=!1;for(let c=0;c<a&&!e.stopped();c+=1){if(l(p,s),p=!0,h>=50){e.append("[MaxEntries]");break}h+=1;let d;try{d=Reflect.getOwnPropertyDescriptor(r,String(c))}catch(z){e.append("[Uninspectable]");continue}d!=null&&d.enumerable?A(d,s+1):e.append("[Empty]")}f("]",p,s)}function W(r,s){let u;try{u=Reflect.ownKeys(r)}catch(p){e.append("[Uninspectable]");return}e.append("{");let a=!1;for(let p of u){if(e.stopped())break;if(h>=50){l(a,s),a=!0,m(e,"\u2026"),e.append(i?": ":":"),e.append("[MaxEntries]");break}h+=1;let c;try{c=Reflect.getOwnPropertyDescriptor(r,p)}catch(d){l(a,s),a=!0,k(e,p),e.append(i?": ":":"),e.append("[Uninspectable]");continue}c!=null&&c.enumerable&&(l(a,s),a=!0,k(e,p),e.append(i?": ":":"),A(c,s+1))}f("}",a,s)}function R(r,s){if(o.has(r)){e.append("[Circular]");return}if(s>=5){e.append("[MaxDepth]");return}let u;try{u=Array.isArray(r)}catch(a){e.append("[Uninspectable]");return}o.add(r);try{u?$(r,s):W(r,s)}finally{o.delete(r)}}function w(r,s){r===null?e.append("null"):typeof r=="string"?m(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"?j(e,r):typeof r=="function"?e.append("[Function]"):R(r,s)}try{return w(t,0),e.result()}catch(r){return"[Uninspectable]"}}var Z=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 O,q=(O=Object.getOwnPropertyDescriptor(RegExp.prototype,"source"))==null?void 0:O.get;var J=Date.prototype.getTime;var D="6.2.1";var _=D,I={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function V(t,n){if(!Array.isArray(t)||!t.length)return t;let e=b(b({},I),n),i,o;if(e.strictlyTwoElementsInRangeArrays&&!t.every((l,f)=>!Array.isArray(l)||l.length!==2?(i=f,o=l.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(i,"th range (").concat(v(t[i],4),") has not two but ").concat(o," elements!"));if(!t.every((l,f)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[1]<0?(i=f,!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(i,"th range (").concat(v(t[i],4),") does not consist of only natural numbers!"));let h=t.length**2,g=0;return Array.from(t).sort((l,f)=>(e.progressFn&&(g+=1,e.progressFn(Math.floor(g*100/h))),l[0]===f[0]?l[1]<f[1]?-1:l[1]>f[1]?1:0:l[0]<f[0]?-1:1))}return F(Q);})();
11
11
  /**
12
12
  * @name codsen-utils
13
13
  * @fileoverview Various utility functions
14
- * @version 1.8.0
14
+ * @version 1.9.0
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/codsen-utils/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ranges-sort",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "Sort string index ranges",
5
5
  "keywords": ["array", "indexes", "ranges", "sort", "string"],
6
6
  "homepage": "https://codsen.com/os/ranges-sort",
@@ -58,7 +58,7 @@
58
58
  }
59
59
  },
60
60
  "dependencies": {
61
- "codsen-utils": "^1.8.0"
61
+ "codsen-utils": "^1.9.0"
62
62
  },
63
63
  "engines": {
64
64
  "node": ">=18.20.8"