@thi.ng/trie 2.0.20 → 2.0.22

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 CHANGED
@@ -91,13 +91,13 @@ import { defMultiTrie } from "@thi.ng/trie";
91
91
  import { ArraySet } from "@thi.ng/associative";
92
92
 
93
93
  // init w/ custom value set type (here purely for illustration)
94
- const t = defMultiTrie<string, string>(null, { values: () => new ArraySet() });
94
+ const t = defMultiTrie<string, number>(null, { values: () => new ArraySet() });
95
95
 
96
96
  t.add("to be or not to be".split(" "), 1);
97
97
  t.add("to be or not to be".split(" "), 2);
98
98
  t.add("to be and to live".split(" "), 3);
99
99
 
100
- console.log(t.get("to be or not to be".split(" ")))
100
+ console.log(t.get("to be or not to be".split(" ")));
101
101
  // Set(2) { 1, 2 }
102
102
 
103
103
  console.log(t.knownPrefix(["to", "be", "not"]));
package/multi-trie.d.ts CHANGED
@@ -16,10 +16,10 @@ export declare class MultiTrie<K, V> {
16
16
  next: Map<K, MultiTrie<K, V>>;
17
17
  vals?: Set<V>;
18
18
  constructor(pairs?: Nullable<Iterable<Pair<K[], V>>>, opts?: Partial<MultiTrieOpts<V>> | undefined);
19
- [Symbol.iterator](): Generator<Pair<K, V>, void, any>;
19
+ [Symbol.iterator](): Generator<Pair<K[], V>, void, any>;
20
20
  keys(prefix?: K[], includePrefix?: boolean): Generator<K[], void, any>;
21
21
  values(prefix?: K[]): Generator<V, void, any>;
22
- entries(prefix?: K[], includePrefix?: boolean): Generator<Pair<K, V>, void, any>;
22
+ entries(prefix?: K[], includePrefix?: boolean): Generator<Pair<K[], V>, void, any>;
23
23
  clear(): void;
24
24
  has(key: K[]): boolean;
25
25
  hasPrefix(prefix: K[]): boolean;
@@ -34,7 +34,7 @@ export declare class MultiTrie<K, V> {
34
34
  knownPrefix(key: K[]): K[];
35
35
  hasKnownPrefix(key: K[]): boolean;
36
36
  add(key: K[], val: V): void;
37
- into(pairs: Iterable<[K[], V]>): void;
37
+ into(pairs: Iterable<Pair<K[], V>>): void;
38
38
  delete(prefix: K[], val?: V): boolean;
39
39
  toJSON(): SerializedMultiTrie<V>;
40
40
  protected iterate<T>(fn: Fn2<K[], MultiTrie<K, V>, Iterable<T>>, prefix?: K[], includePrefix?: boolean): Generator<T, void, any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/trie",
3
- "version": "2.0.20",
3
+ "version": "2.0.22",
4
4
  "description": "Trie-based ES6-like Map data structures with prefix search/query support",
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.12.21"
43
+ "@thi.ng/api": "^8.12.22"
44
44
  },
45
45
  "devDependencies": {
46
46
  "esbuild": "^0.28.0",
47
- "typedoc": "^0.28.18",
48
- "typescript": "^5.9.3"
47
+ "typedoc": "^0.28.19",
48
+ "typescript": "^6.0.3"
49
49
  },
50
50
  "keywords": [
51
51
  "associative",
@@ -94,5 +94,5 @@
94
94
  ],
95
95
  "year": 2020
96
96
  },
97
- "gitHead": "dcaa4e2beb427e434a68cba1259a9bf9983a569a"
97
+ "gitHead": "ecb3c8877c7f6d086daec889bf618fe3558d87f2"
98
98
  }