ranges-sort 6.1.3 → 6.2.0

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,11 +3,24 @@
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.1.0 (2025-10-15)
6
+ ## 6.2.0 (2026-08-19)
7
+
8
+ ### Bug Fixes
9
+
10
+ - 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))
12
+ - retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
13
+ - standardise range sorting errs ([80ef071](https://github.com/codsen/codsen/commit/80ef07195b5e5baec63d295fa236f8610f9f954f))
7
14
 
8
15
  ### Features
9
16
 
10
- - if value to be added is a number, keep it as is, don't stringify ([ce3e1a5](https://github.com/codsen/codsen/commit/ce3e1a525998ca3c0abf0142affef95b14cd1990))
17
+ - add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
18
+ - refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
19
+
20
+ ### Reverts
21
+
22
+ - Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
23
+ - Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
11
24
 
12
25
  ## 6.0.0 (2022-12-01)
13
26
 
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright © 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2026 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/README.md CHANGED
@@ -32,7 +32,7 @@ npm i ranges-sort
32
32
  ## Quick Take
33
33
 
34
34
  ```js
35
- import { strict as assert } from "assert";
35
+ import { strict as assert } from "node:assert";
36
36
 
37
37
  import { rSort } from "ranges-sort";
38
38
 
@@ -51,9 +51,10 @@ assert.deepEqual(
51
51
  );
52
52
  ```
53
53
 
54
+
54
55
  ## Documentation
55
56
 
56
- Please [visit codsen.com](https://codsen.com/os/ranges-sort/) for a full description of the API.
57
+ Please [visit codsen.com](https://codsen.com/os/ranges-sort/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/ranges-sort/CHANGELOG.md).
57
58
 
58
59
  ## Contributing
59
60
 
@@ -63,6 +64,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
63
64
 
64
65
  MIT License
65
66
 
66
- Copyright © 2010-2025 Roy Revelt and other contributors
67
+ Copyright © 2010-2026 Roy Revelt and other contributors
67
68
 
68
69
  <p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name ranges-sort
3
3
  * @fileoverview Sort string index ranges
4
- * @version 6.1.3
4
+ * @version 6.2.0
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/ranges-sort/}
8
8
  */
9
9
 
10
- var l="6.1.3";var y=l,c={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function g(t,u){if(!Array.isArray(t)||!t.length)return t;let n={...c,...u},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: [THROW_ID_03] 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 (${JSON.stringify(t[s],null,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: [THROW_ID_04] 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 (${JSON.stringify(t[s],null,4)}) does not consist of only natural numbers!`);let p=t.length**2,i=0;return Array.from(t).sort((e,r)=>(n.progressFn&&(i+=1,n.progressFn(Math.floor(i*100/p))),e[0]===r[0]?e[1]<r[1]?-1:e[1]>r[1]?1:0:e[0]<r[0]?-1:1))}export{c as defaults,g as rSort,y as version};
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};
@@ -1,10 +1,18 @@
1
1
  /**
2
2
  * @name ranges-sort
3
3
  * @fileoverview Sort string index ranges
4
- * @version 6.1.3
4
+ * @version 6.2.0
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 l=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames,a=Object.getOwnPropertySymbols;var d=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var c=(e,t,r)=>t in e?l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,u=(e,t)=>{for(var r in t||(t={}))d.call(t,r)&&c(e,r,t[r]);if(a)for(var r of a(t))x.call(t,r)&&c(e,r,t[r]);return e};var b=(e,t)=>{for(var r in t)l(e,r,{get:t[r],enumerable:!0})},v=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of f(t))!d.call(e,o)&&o!==r&&l(e,o,{get:()=>t[o],enumerable:!(n=h(t,o))||n.enumerable});return e};var w=e=>v(l({},"__esModule",{value:!0}),e);var E={};b(E,{defaults:()=>y,rSort:()=>I,version:()=>j});var m="6.1.3";var j=m,y={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function I(e,t){if(!Array.isArray(e)||!e.length)return e;let r=u(u({},y),t),n,o;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,i)=>!Array.isArray(s)||s.length!==2?(n=i,o=s.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(n,"th range (").concat(JSON.stringify(e[n],null,4),") has not two but ").concat(o," elements!"));if(!e.every((s,i)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(n=i,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(n,"th range (").concat(JSON.stringify(e[n],null,4),") does not consist of only natural numbers!"));let g=e.length**2,p=0;return Array.from(e).sort((s,i)=>(r.progressFn&&(p+=1,r.progressFn(Math.floor(p*100/g))),s[0]===i[0]?s[1]<i[1]?-1:s[1]>i[1]?1:0:s[0]<i[0]?-1:1))}return w(E);})();
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);})();
11
+ /**
12
+ * @name codsen-utils
13
+ * @fileoverview Various utility functions
14
+ * @version 1.8.0
15
+ * @author Roy Revelt
16
+ * @license MIT
17
+ * {@link https://codsen.com/os/codsen-utils/}
18
+ */
package/package.json CHANGED
@@ -1,14 +1,8 @@
1
1
  {
2
2
  "name": "ranges-sort",
3
- "version": "6.1.3",
3
+ "version": "6.2.0",
4
4
  "description": "Sort string index ranges",
5
- "keywords": [
6
- "array",
7
- "indexes",
8
- "ranges",
9
- "sort",
10
- "string"
11
- ],
5
+ "keywords": ["array", "indexes", "ranges", "sort", "string"],
12
6
  "homepage": "https://codsen.com/os/ranges-sort",
13
7
  "repository": {
14
8
  "type": "git",
@@ -29,41 +23,46 @@
29
23
  },
30
24
  "types": "types/index.d.ts",
31
25
  "scripts": {
32
- "build": "node '../../ops/scripts/esbuild.js' && npm run dts",
33
- "cjs-off": "exit 0",
34
- "cjs-on": "exit 0",
35
- "dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
26
+ "build": "node ../../ops/scripts/esbuild.js && npm run dts",
27
+ "coverage": "c8 uvu test",
28
+ "dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
36
29
  "devtest": "c8 npm run unit && npm run examples && npm run lint",
37
- "dts": "rollup -c && npm run prettier -- 'types/index.d.ts' --write --log-level 'silent'",
30
+ "dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
38
31
  "examples": "node '../../ops/scripts/run-examples.js'",
39
- "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
40
- "letspublish": "npm publish --provenance || :",
41
- "lint": "eslint . --fix --concurrency=auto --cache",
32
+ "lect": "node '../../ops/lect/lect.js'",
33
+ "lect:check": "node '../../ops/lect/lect.js' --check",
34
+ "lint": "biome lint --error-on-warnings . && npm run typecheck",
35
+ "lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
42
36
  "perf": "node perf/check.js",
43
37
  "prep": "echo 'ready'",
44
- "prettier": "prettier",
45
- "prettier:format": "npm run prettier -- --write '**/*.{ts,tsx,md}' --no-error-on-unmatched-pattern --log-level 'silent'",
46
- "pretest": "npm run lect && npm run build",
38
+ "prettier": "biome format",
39
+ "prettier:format": "biome format --write .",
40
+ "pretest": "npm run lect:check && npm run build",
47
41
  "test": "npm run devtest",
42
+ "typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
48
43
  "unit": "uvu test"
49
44
  },
50
- "engines": {
51
- "node": ">=14.18.0"
52
- },
53
45
  "c8": {
46
+ "all": true,
47
+ "branches": 100,
54
48
  "check-coverage": true,
55
- "exclude": [
56
- "**/test/**/*.*"
57
- ],
58
- "lines": 100
49
+ "exclude": ["**/test/**/*.*"],
50
+ "functions": 100,
51
+ "include": ["dist/*.esm.js"],
52
+ "lines": 100,
53
+ "statements": 100
59
54
  },
60
55
  "lect": {
61
56
  "licence": {
62
- "extras": [
63
- ""
64
- ]
57
+ "extras": [""]
65
58
  }
66
59
  },
60
+ "dependencies": {
61
+ "codsen-utils": "^1.8.0"
62
+ },
63
+ "engines": {
64
+ "node": ">=18.20.8"
65
+ },
67
66
  "publishConfig": {
68
67
  "registry": "https://registry.npmjs.org/"
69
68
  }