@thi.ng/transducers 9.6.7 → 9.6.9
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 +10 -1
- package/README.md +1 -1
- package/package.json +13 -13
- package/range.js +6 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2025-
|
|
3
|
+
- **Last updated**: 2025-09-01T16:38:35Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -11,6 +11,15 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
11
11
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
12
12
|
and/or version bumps of transitive dependencies.
|
|
13
13
|
|
|
14
|
+
### [9.6.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers@9.6.9) (2025-09-01)
|
|
15
|
+
|
|
16
|
+
#### ♻️ Refactoring
|
|
17
|
+
|
|
18
|
+
- internal update range(), improve precision ([437021f](https://github.com/thi-ng/umbrella/commit/437021f))
|
|
19
|
+
- use `from + i * step` to avoid float error accumulation
|
|
20
|
+
- update Range iterator and `$reduce()` impls
|
|
21
|
+
- add tests
|
|
22
|
+
|
|
14
23
|
## [9.6.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/transducers@9.6.0) (2025-07-13)
|
|
15
24
|
|
|
16
25
|
#### 🚀 Features
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/transducers",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.9",
|
|
4
4
|
"description": "Collection of ~170 lightweight, composable transducers, reducers, generators, iterators for functional data transformations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@thi.ng/api": "^8.12.
|
|
47
|
-
"@thi.ng/arrays": "^2.13.
|
|
48
|
-
"@thi.ng/checks": "^3.7.
|
|
49
|
-
"@thi.ng/compare": "^2.4.
|
|
50
|
-
"@thi.ng/compose": "^3.0.
|
|
51
|
-
"@thi.ng/errors": "^2.5.
|
|
52
|
-
"@thi.ng/math": "^5.
|
|
53
|
-
"@thi.ng/random": "^4.1.
|
|
54
|
-
"@thi.ng/timestamp": "^1.1.
|
|
46
|
+
"@thi.ng/api": "^8.12.2",
|
|
47
|
+
"@thi.ng/arrays": "^2.13.11",
|
|
48
|
+
"@thi.ng/checks": "^3.7.18",
|
|
49
|
+
"@thi.ng/compare": "^2.4.28",
|
|
50
|
+
"@thi.ng/compose": "^3.0.39",
|
|
51
|
+
"@thi.ng/errors": "^2.5.42",
|
|
52
|
+
"@thi.ng/math": "^5.12.0",
|
|
53
|
+
"@thi.ng/random": "^4.1.27",
|
|
54
|
+
"@thi.ng/timestamp": "^1.1.21"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"esbuild": "^0.25.
|
|
58
|
-
"typedoc": "^0.28.
|
|
57
|
+
"esbuild": "^0.25.9",
|
|
58
|
+
"typedoc": "^0.28.12",
|
|
59
59
|
"typescript": "^5.9.2"
|
|
60
60
|
},
|
|
61
61
|
"keywords": [
|
|
@@ -609,5 +609,5 @@
|
|
|
609
609
|
],
|
|
610
610
|
"year": 2016
|
|
611
611
|
},
|
|
612
|
-
"gitHead": "
|
|
612
|
+
"gitHead": "e215a3e8de3809736ba0042c93bd8703a5a1a337\n"
|
|
613
613
|
}
|
package/range.js
CHANGED
|
@@ -20,29 +20,15 @@ class Range {
|
|
|
20
20
|
this.step = step;
|
|
21
21
|
}
|
|
22
22
|
*[Symbol.iterator]() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
yield from;
|
|
27
|
-
from += step;
|
|
28
|
-
}
|
|
29
|
-
} else if (step < 0) {
|
|
30
|
-
while (from > to) {
|
|
31
|
-
yield from;
|
|
32
|
-
from += step;
|
|
33
|
-
}
|
|
23
|
+
const { from, to, step } = this;
|
|
24
|
+
for (let i = 0, x; x = from + i * step, step >= 0 && x < to || step < 0 && x > to; i++) {
|
|
25
|
+
yield x;
|
|
34
26
|
}
|
|
35
27
|
}
|
|
36
28
|
$reduce(rfn, acc) {
|
|
37
|
-
const step = this
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
acc = rfn(acc, i);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
for (let i = this.from, n = this.to; i > n && !isReduced(acc); i += step) {
|
|
44
|
-
acc = rfn(acc, i);
|
|
45
|
-
}
|
|
29
|
+
const { from, to, step } = this;
|
|
30
|
+
for (let i = 0, x; x = from + i * step, !isReduced(acc) && (step >= 0 && x < to || step < 0 && x > to); i++) {
|
|
31
|
+
acc = rfn(acc, x);
|
|
46
32
|
}
|
|
47
33
|
return acc;
|
|
48
34
|
}
|