Skip to content

uncompressedSegmentedTrie<V>(entries?): SegmentedTrie<V>

Defined in: packages/trie/src/uncompressed-segmented-trie.ts:267

Create a SegmentedTrie backed by one node per distinct segment prefix, each holding its children in a Map keyed by the next segment.

Shared key prefixes are stored once and looked up once, which is what turns longest-prefix resolution into a single top-down walk. Prefer compressedSegmentedTrie when keys are deep or mostly non-branching, which is when packing segment runs into edge labels pays for its split bookkeeping; prefer a plain Map<string, V> keyed on the joined string when only exact matches are needed.

V

Iterable<SegmentedTrieEntry<V>, any, any>

Key-value pairs to store, in iteration order. A repeated key overwrites the earlier value, mirroring Map, and entries before an invalid one stay stored.

SegmentedTrie<V>

When an entry key is not an array of strings.