@blackglory/structures 0.6.0 → 0.6.1
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 +4 -0
- package/dist/es2015/index.min.mjs +1 -1
- package/dist/es2015/index.min.mjs.map +1 -1
- package/dist/es2015/index.mjs +18 -0
- package/dist/es2015/index.mjs.map +1 -1
- package/dist/es2015/index.umd.js +18 -0
- package/dist/es2015/index.umd.js.map +1 -1
- package/dist/es2015/index.umd.min.js +1 -1
- package/dist/es2015/index.umd.min.js.map +1 -1
- package/dist/es2018/index.min.mjs +1 -1
- package/dist/es2018/index.min.mjs.map +1 -1
- package/dist/es2018/index.mjs +18 -0
- package/dist/es2018/index.mjs.map +1 -1
- package/dist/es2018/index.umd.js +18 -0
- package/dist/es2018/index.umd.js.map +1 -1
- package/dist/es2018/index.umd.min.js +1 -1
- package/dist/es2018/index.umd.min.js.map +1 -1
- package/lib/es2015/trie-map.d.ts +3 -0
- package/lib/es2015/trie-map.js +19 -0
- package/lib/es2015/trie-map.js.map +1 -1
- package/lib/es2018/trie-map.d.ts +3 -0
- package/lib/es2018/trie-map.js +19 -0
- package/lib/es2018/trie-map.js.map +1 -1
- package/package.json +1 -1
package/dist/es2015/index.mjs
CHANGED
|
@@ -7558,6 +7558,24 @@ class TrieMap {
|
|
|
7558
7558
|
get [Symbol.toStringTag]() {
|
|
7559
7559
|
return this.constructor.name;
|
|
7560
7560
|
}
|
|
7561
|
+
*entries() {
|
|
7562
|
+
yield* dfs(this.root, []);
|
|
7563
|
+
function* dfs(node, paths) {
|
|
7564
|
+
for (const [path, childNode] of node.children) {
|
|
7565
|
+
const newPaths = [...paths, path];
|
|
7566
|
+
if (es2018$2.isntUndefined(childNode.value)) {
|
|
7567
|
+
yield [newPaths, childNode.value];
|
|
7568
|
+
}
|
|
7569
|
+
yield* dfs(childNode, newPaths);
|
|
7570
|
+
}
|
|
7571
|
+
}
|
|
7572
|
+
}
|
|
7573
|
+
keys() {
|
|
7574
|
+
return es2018$4.map(this.entries(), ([key]) => key);
|
|
7575
|
+
}
|
|
7576
|
+
values() {
|
|
7577
|
+
return es2018$4.map(this.entries(), ([_, value]) => value);
|
|
7578
|
+
}
|
|
7561
7579
|
set(key, value) {
|
|
7562
7580
|
let node = this.root;
|
|
7563
7581
|
for (const part of key) {
|