@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/es2018/index.umd.js
CHANGED
|
@@ -7564,6 +7564,24 @@
|
|
|
7564
7564
|
get [Symbol.toStringTag]() {
|
|
7565
7565
|
return this.constructor.name;
|
|
7566
7566
|
}
|
|
7567
|
+
*entries() {
|
|
7568
|
+
yield* dfs(this.root, []);
|
|
7569
|
+
function* dfs(node, paths) {
|
|
7570
|
+
for (const [path, childNode] of node.children) {
|
|
7571
|
+
const newPaths = [...paths, path];
|
|
7572
|
+
if (es2018$2.isntUndefined(childNode.value)) {
|
|
7573
|
+
yield [newPaths, childNode.value];
|
|
7574
|
+
}
|
|
7575
|
+
yield* dfs(childNode, newPaths);
|
|
7576
|
+
}
|
|
7577
|
+
}
|
|
7578
|
+
}
|
|
7579
|
+
keys() {
|
|
7580
|
+
return es2018$4.map(this.entries(), ([key]) => key);
|
|
7581
|
+
}
|
|
7582
|
+
values() {
|
|
7583
|
+
return es2018$4.map(this.entries(), ([_, value]) => value);
|
|
7584
|
+
}
|
|
7567
7585
|
set(key, value) {
|
|
7568
7586
|
let node = this.root;
|
|
7569
7587
|
for (const part of key) {
|