(root: Node<V> | undefined)
| 69 | } |
| 70 | |
| 71 | const makeImpl = <V>(root: Node<V> | undefined): TrieImpl<V> => { |
| 72 | const trie = Object.create(TrieProto) |
| 73 | trie._root = root |
| 74 | trie._count = root?.count ?? 0 |
| 75 | return trie |
| 76 | } |
| 77 | |
| 78 | class TrieIterator<in out V, out T> implements IterableIterator<T> { |
| 79 | stack: Array<[Node<V>, string, boolean]> = [] |