@thi.ng/trie 2.0.8 → 2.0.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/README.md +1 -1
- package/multi-trie.js +3 -3
- package/package.json +3 -3
- package/trie-map.js +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
> [!NOTE]
|
|
10
|
-
> This is one of
|
|
10
|
+
> This is one of 211 standalone projects, maintained as part
|
|
11
11
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
12
12
|
> and anti-framework.
|
|
13
13
|
>
|
package/multi-trie.js
CHANGED
|
@@ -85,7 +85,7 @@ class MultiTrie {
|
|
|
85
85
|
node.vals.add(val);
|
|
86
86
|
}
|
|
87
87
|
into(pairs) {
|
|
88
|
-
for (
|
|
88
|
+
for (const [k, v] of pairs) {
|
|
89
89
|
this.add(k, v);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -151,9 +151,9 @@ const defMultiTrieFromJSON = (src, opts) => {
|
|
|
151
151
|
while (queue.length) {
|
|
152
152
|
const [key, node] = queue.pop();
|
|
153
153
|
if (node.vals) {
|
|
154
|
-
for (
|
|
154
|
+
for (const v of node.vals) res.add(key, v);
|
|
155
155
|
}
|
|
156
|
-
for (
|
|
156
|
+
for (const [k, child] of Object.entries(node.next)) {
|
|
157
157
|
queue.push([[...key, k], child]);
|
|
158
158
|
}
|
|
159
159
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/trie",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "Trie-based ES6-like Map data structures with prefix search/query support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@thi.ng/api": "^8.12.
|
|
42
|
+
"@thi.ng/api": "^8.12.10"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"esbuild": "^0.27.0",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
],
|
|
94
94
|
"year": 2020
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "824bf9047b5a10f777c5c5b4aeecf0c750a22c75\n"
|
|
97
97
|
}
|
package/trie-map.js
CHANGED
|
@@ -75,7 +75,7 @@ class TrieMap {
|
|
|
75
75
|
node.val = val;
|
|
76
76
|
}
|
|
77
77
|
into(pairs) {
|
|
78
|
-
for (
|
|
78
|
+
for (const [k, v] of pairs) {
|
|
79
79
|
this.set(k, v);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -123,7 +123,7 @@ const defTrieMapFromJSON = (src) => {
|
|
|
123
123
|
while (queue.length) {
|
|
124
124
|
const [key, node] = queue.pop();
|
|
125
125
|
if (node.val) res.set(key, node.val);
|
|
126
|
-
for (
|
|
126
|
+
for (const [k, child] of Object.entries(node.next)) {
|
|
127
127
|
queue.push([key + k, child]);
|
|
128
128
|
}
|
|
129
129
|
}
|