@thi.ng/sorted-map 1.1.17 → 1.1.19
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 +7 -1
- package/README.md +2 -2
- package/package.json +8 -8
- package/sorted-map.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**:
|
|
3
|
+
- **Last updated**: 2025-01-14T12:23:33Z
|
|
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.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [1.1.19](https://github.com/thi-ng/umbrella/tree/@thi.ng/sorted-map@1.1.19) (2025-01-14)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- use optional chaining & nullish coalescing ([c5a0a13](https://github.com/thi-ng/umbrella/commit/c5a0a13))
|
|
17
|
+
|
|
12
18
|
## [1.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/sorted-map@1.1.0) (2024-07-22)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -153,7 +153,7 @@ For Node.js REPL:
|
|
|
153
153
|
const sm = await import("@thi.ng/sorted-map");
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Package sizes (brotli'd, pre-treeshake): ESM: 1.
|
|
156
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 1.70 KB
|
|
157
157
|
|
|
158
158
|
## Dependencies
|
|
159
159
|
|
|
@@ -215,4 +215,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
215
215
|
|
|
216
216
|
## License
|
|
217
217
|
|
|
218
|
-
© 2018 -
|
|
218
|
+
© 2018 - 2025 Karsten Schmidt // Apache License 2.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/sorted-map",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"description": "Skiplist-based sorted map & set implementation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@thi.ng/api": "^8.11.
|
|
44
|
-
"@thi.ng/associative": "^7.0.
|
|
45
|
-
"@thi.ng/checks": "^3.6.
|
|
46
|
-
"@thi.ng/compare": "^2.4.
|
|
47
|
-
"@thi.ng/random": "^4.1.
|
|
48
|
-
"@thi.ng/transducers": "^9.2.
|
|
43
|
+
"@thi.ng/api": "^8.11.16",
|
|
44
|
+
"@thi.ng/associative": "^7.0.19",
|
|
45
|
+
"@thi.ng/checks": "^3.6.19",
|
|
46
|
+
"@thi.ng/compare": "^2.4.8",
|
|
47
|
+
"@thi.ng/random": "^4.1.7",
|
|
48
|
+
"@thi.ng/transducers": "^9.2.13"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@microsoft/api-extractor": "^7.48.1",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
],
|
|
100
100
|
"year": 2018
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "6542b842120bef47cc18d45a1b1db68307a7f04b\n"
|
|
103
103
|
}
|
package/sorted-map.js
CHANGED
|
@@ -51,7 +51,7 @@ let SortedMap = class extends Map {
|
|
|
51
51
|
}
|
|
52
52
|
*[Symbol.iterator]() {
|
|
53
53
|
let node = this.firstNode();
|
|
54
|
-
while (node
|
|
54
|
+
while (node?.k !== void 0) {
|
|
55
55
|
yield [node.k, node.v];
|
|
56
56
|
node = node.next;
|
|
57
57
|
}
|
|
@@ -80,7 +80,7 @@ let SortedMap = class extends Map {
|
|
|
80
80
|
if (!size) return;
|
|
81
81
|
if (max) {
|
|
82
82
|
let node = this.firstNode();
|
|
83
|
-
while (node
|
|
83
|
+
while (node?.k !== void 0 && cmp(node.k, key) <= 0) {
|
|
84
84
|
yield [node.k, node.v];
|
|
85
85
|
node = node.next;
|
|
86
86
|
}
|
|
@@ -145,7 +145,7 @@ let SortedMap = class extends Map {
|
|
|
145
145
|
}
|
|
146
146
|
first() {
|
|
147
147
|
const node = this.firstNode();
|
|
148
|
-
return node
|
|
148
|
+
return node?.k !== void 0 ? [node.k, node.v] : void 0;
|
|
149
149
|
}
|
|
150
150
|
get(key, notFound) {
|
|
151
151
|
const $this = __private.get(this);
|
|
@@ -237,7 +237,7 @@ let SortedMap = class extends Map {
|
|
|
237
237
|
}
|
|
238
238
|
$reduce(rfn, acc) {
|
|
239
239
|
let node = this.firstNode();
|
|
240
|
-
while (node
|
|
240
|
+
while (node?.k !== void 0 && !isReduced(acc)) {
|
|
241
241
|
acc = rfn(acc, [node.k, node.v]);
|
|
242
242
|
node = node.next;
|
|
243
243
|
}
|