ranges-iterate 4.1.3 → 4.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 +18 -2
- package/LICENSE +1 -1
- package/README.md +4 -3
- package/dist/ranges-iterate.esm.js +2 -2
- package/dist/ranges-iterate.umd.js +10 -2
- package/package.json +22 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,27 @@
|
|
|
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.
|
|
6
|
+
## 4.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))
|
|
7
13
|
|
|
8
14
|
### Features
|
|
9
15
|
|
|
10
|
-
-
|
|
16
|
+
- add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
|
|
17
|
+
- refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
|
|
18
|
+
|
|
19
|
+
### Performance Improvements
|
|
20
|
+
|
|
21
|
+
- iterate ranges without cloning input ([9199fc9](https://github.com/codsen/codsen/commit/9199fc9fe233563b710f4f8afcf9732a85827bbc))
|
|
22
|
+
|
|
23
|
+
### Reverts
|
|
24
|
+
|
|
25
|
+
- 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)
|
|
26
|
+
- 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
27
|
|
|
12
28
|
## 4.0.0 (2022-12-01)
|
|
13
29
|
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2010-
|
|
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-iterate
|
|
|
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 { rIterate } from "ranges-iterate";
|
|
38
38
|
|
|
@@ -56,9 +56,10 @@ assert.deepEqual(gathered, [
|
|
|
56
56
|
]);
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
|
|
59
60
|
## Documentation
|
|
60
61
|
|
|
61
|
-
Please [visit codsen.com](https://codsen.com/os/ranges-iterate/) for a full description of the API.
|
|
62
|
+
Please [visit codsen.com](https://codsen.com/os/ranges-iterate/) 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-iterate/CHANGELOG.md).
|
|
62
63
|
|
|
63
64
|
## Contributing
|
|
64
65
|
|
|
@@ -68,6 +69,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
68
69
|
|
|
69
70
|
MIT License
|
|
70
71
|
|
|
71
|
-
Copyright © 2010-
|
|
72
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
72
73
|
|
|
73
74
|
<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-iterate
|
|
3
3
|
* @fileoverview Iterate a string and any changes within given string index ranges
|
|
4
|
-
* @version 4.
|
|
4
|
+
* @version 4.2.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ranges-iterate/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
import{formatDiagnosticValue as u}from"codsen-utils";var p="4.2.0";var I=p;function x(t,s,n,c=0){if(typeof t!="string")throw new TypeError(`ranges-iterate/rIterate(): [THROW_ID_01] Input string must be a string! It was given as ${typeof t}, equal to: ${u(t)}`);if(!t.length)throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_02] Input string must be non-empty!");if(s!=null&&!Array.isArray(s))throw new TypeError(`ranges-iterate/rIterate(): [THROW_ID_03] Input ranges must be an array, consisting of zero or more arrays! Currently its type is: ${typeof s}, equal to: ${u(s)}`);if(n){if(typeof n!="function")throw new TypeError(`ranges-iterate/rIterate(): [THROW_ID_05] The callback function (third input argument) must be a function. It was given as: ${typeof n}, equal to: ${u(n)}`)}else throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_04] You should provide a callback function as third input argument!");if(s?.length){let e=s,o=c,r=c;if(r<e[0][0])for(;r<e[0][0]&&t[r];r++,o++)n({i:r,val:t[r]});if(e[0][0]<=o)for(let i=0;i<e.length;i++){let l=e[i];if(l[2])for(let a=0,d=l[2].length;a<d;a++)n({i:r,val:l[2][a]}),r+=1;for(;o<l[1];)o+=1;let m=t.length;for(e[i+1]&&(m=e[i+1][0]);o<m;r++,o++)n({i:r,val:t[o]})}}else for(let e=0;e<t.length;e++)n({i:e,val:t[e]})}export{x as rIterate,I as version};
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name ranges-iterate
|
|
3
3
|
* @fileoverview Iterate a string and any changes within given string index ranges
|
|
4
|
-
* @version 4.
|
|
4
|
+
* @version 4.2.0
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/ranges-iterate/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var rangesIterate=(()=>{var
|
|
10
|
+
"use strict";var rangesIterate=(()=>{var x=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var j=(t,n)=>{for(var e in n)x(t,e,{get:n[e],enumerable:!0})},E=(t,n,e,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of O(n))!S.call(t,l)&&l!==e&&x(t,l,{get:()=>n[l],enumerable:!(i=D(n,l))||i.enumerable});return t};var W=t=>E(x({},"__esModule",{value:!0}),t);var U={};j(U,{rIterate:()=>L,version:()=>V});function R(){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 M(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(M(i)):t.append(n[e])}t.append('"')}}function B(t){return t.get&&t.set?"[Getter/Setter]":t.get?"[Getter]":t.set?"[Setter]":"[Accessor]"}function I(t,n){t.append("Symbol(");let e=String(n);e.length>8&&y(t,e.slice(7,-1)),t.append(")")}function A(t,n){typeof n=="symbol"?I(t,n):y(t,String(n))}function $(t,n=0){let e=R(),i=n===4?4:0,l=new WeakSet,u=0;function o(r){i&&e.append(" ".repeat(r*i))}function c(r,s){r&&e.append(","),i&&(e.append("\n"),o(s+1))}function g(r,s,a){i&&s&&(e.append("\n"),o(a)),e.append(r)}function m(r,s){Object.prototype.hasOwnProperty.call(r,"value")?w(r.value,s):e.append(B(r))}function b(r,s){let a;try{a=Reflect.getOwnPropertyDescriptor(r,"length")}catch(p){e.append("[Uninspectable]");return}let f=a==null?void 0:a.value;if(!Number.isSafeInteger(f)||f<0){e.append("[Uninspectable]");return}e.append("[");let d=!1;for(let p=0;p<f&&!e.stopped();p+=1){if(c(d,s),d=!0,u>=50){e.append("[MaxEntries]");break}u+=1;let h;try{h=Reflect.getOwnPropertyDescriptor(r,String(p))}catch(P){e.append("[Uninspectable]");continue}h!=null&&h.enumerable?m(h,s+1):e.append("[Empty]")}g("]",d,s)}function v(r,s){let a;try{a=Reflect.ownKeys(r)}catch(d){e.append("[Uninspectable]");return}e.append("{");let f=!1;for(let d of a){if(e.stopped())break;if(u>=50){c(f,s),f=!0,y(e,"\u2026"),e.append(i?": ":":"),e.append("[MaxEntries]");break}u+=1;let p;try{p=Reflect.getOwnPropertyDescriptor(r,d)}catch(h){c(f,s),f=!0,A(e,d),e.append(i?": ":":"),e.append("[Uninspectable]");continue}p!=null&&p.enumerable&&(c(f,s),f=!0,A(e,d),e.append(i?": ":":"),m(p,s+1))}g("}",f,s)}function k(r,s){if(l.has(r)){e.append("[Circular]");return}if(s>=5){e.append("[MaxDepth]");return}let a;try{a=Array.isArray(r)}catch(f){e.append("[Uninspectable]");return}l.add(r);try{a?b(r,s):v(r,s)}finally{l.delete(r)}}function w(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"?I(e,r):typeof r=="function"?e.append("[Function]"):k(r,s)}try{return w(t,0),e.result()}catch(r){return"[Uninspectable]"}}var _=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 C="4.2.0";var V=C;function L(t,n,e,i=0){if(typeof t!="string")throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_01] Input string must be a string! It was given as ".concat(typeof t,", equal to: ").concat($(t)));if(!t.length)throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_02] Input string must be non-empty!");if(n!=null&&!Array.isArray(n))throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_03] Input ranges must be an array, consisting of zero or more arrays! Currently its type is: ".concat(typeof n,", equal to: ").concat($(n)));if(e){if(typeof e!="function")throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_05] The callback function (third input argument) must be a function. It was given as: ".concat(typeof e,", equal to: ").concat($(e)))}else throw new TypeError("ranges-iterate/rIterate(): [THROW_ID_04] You should provide a callback function as third input argument!");if(n!=null&&n.length){let l=n,u=i,o=i;if(o<l[0][0])for(;o<l[0][0]&&t[o];o++,u++)e({i:o,val:t[o]});if(l[0][0]<=u)for(let c=0;c<l.length;c++){let g=l[c];if(g[2])for(let b=0,v=g[2].length;b<v;b++)e({i:o,val:g[2][b]}),o+=1;for(;u<g[1];)u+=1;let m=t.length;for(l[c+1]&&(m=l[c+1][0]);u<m;o++,u++)e({i:o,val:t[u]})}}else for(let l=0;l<t.length;l++)e({i:l,val:t[l]})}return W(U);})();
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ranges-iterate",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "Iterate a string and any changes within given string index ranges",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -34,44 +34,42 @@
|
|
|
34
34
|
},
|
|
35
35
|
"types": "types/index.d.ts",
|
|
36
36
|
"scripts": {
|
|
37
|
-
"build": "node
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
37
|
+
"build": "node ../../ops/scripts/esbuild.js && npm run dts",
|
|
38
|
+
"coverage": "c8 uvu test",
|
|
39
|
+
"dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
|
|
41
40
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
42
|
-
"dts": "rollup -c &&
|
|
41
|
+
"dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
|
|
43
42
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
44
|
-
"lect": "node '../../ops/lect/lect.js'
|
|
45
|
-
"
|
|
46
|
-
"lint": "
|
|
43
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
44
|
+
"lect:check": "node '../../ops/lect/lect.js' --check",
|
|
45
|
+
"lint": "biome lint --error-on-warnings . && npm run typecheck",
|
|
46
|
+
"lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
|
|
47
47
|
"perf": "node perf/check.js",
|
|
48
48
|
"prep": "echo 'ready'",
|
|
49
|
-
"prettier": "
|
|
50
|
-
"prettier:format": "
|
|
51
|
-
"pretest": "npm run lect && npm run build",
|
|
49
|
+
"prettier": "biome format",
|
|
50
|
+
"prettier:format": "biome format --write .",
|
|
51
|
+
"pretest": "npm run lect:check && npm run build",
|
|
52
52
|
"test": "npm run devtest",
|
|
53
|
+
"typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
|
|
53
54
|
"unit": "uvu test"
|
|
54
55
|
},
|
|
55
|
-
"engines": {
|
|
56
|
-
"node": ">=14.18.0"
|
|
57
|
-
},
|
|
58
56
|
"c8": {
|
|
57
|
+
"all": true,
|
|
59
58
|
"check-coverage": true,
|
|
60
|
-
"exclude": [
|
|
61
|
-
|
|
62
|
-
],
|
|
59
|
+
"exclude": ["**/test/**/*.*"],
|
|
60
|
+
"include": ["dist/*.esm.js"],
|
|
63
61
|
"lines": 100
|
|
64
62
|
},
|
|
65
63
|
"lect": {
|
|
66
64
|
"licence": {
|
|
67
|
-
"extras": [
|
|
68
|
-
""
|
|
69
|
-
]
|
|
65
|
+
"extras": [""]
|
|
70
66
|
}
|
|
71
67
|
},
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"codsen-utils": "^1.8.0"
|
|
70
|
+
},
|
|
71
|
+
"engines": {
|
|
72
|
+
"node": ">=18.20.8"
|
|
75
73
|
},
|
|
76
74
|
"publishConfig": {
|
|
77
75
|
"registry": "https://registry.npmjs.org/"
|