Call Signature
Section titled “Call Signature”deserializeSegmentedTrieJson<
V>(serialized,create?):SegmentedTrie<V>
Defined in: packages/trie/src/serialization/json.ts:201
Rebuild a segmented trie from a SerializedSegmentedTrie, restoring its recorded implementation unless a factory override is supplied. O(k) time for k stored segments.
Entries are replayed in serialized order, so a round trip through
serializeSegmentedTrieJson and deserializeSegmentedTrieJson preserves size,
iteration order, every stored value, and every longestPrefix answer.
Untyped input produces a SegmentedTrie<unknown>. Pass a value type guard
to validate decoded values and recover a narrower value type.
Type Parameters
Section titled “Type Parameters”V
Parameters
Section titled “Parameters”serialized
Section titled “serialized”The trie to restore, either statically typed or decoded
as unknown.
create?
Section titled “create?”Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape, a segment, or
a decoded value is invalid, or an entry repeats a key. Distinguish causes
with error.code, one of TrieParseErrorCode.
Call Signature
Section titled “Call Signature”deserializeSegmentedTrieJson<
V>(serialized,options):SegmentedTrie<V>
Defined in: packages/trie/src/serialization/json.ts:205
Rebuild a segmented trie from a SerializedSegmentedTrie, restoring its recorded implementation unless a factory override is supplied. O(k) time for k stored segments.
Entries are replayed in serialized order, so a round trip through
serializeSegmentedTrieJson and deserializeSegmentedTrieJson preserves size,
iteration order, every stored value, and every longestPrefix answer.
Untyped input produces a SegmentedTrie<unknown>. Pass a value type guard
to validate decoded values and recover a narrower value type.
Type Parameters
Section titled “Type Parameters”V
Parameters
Section titled “Parameters”serialized
Section titled “serialized”unknown
The trie to restore, either statically typed or decoded
as unknown.
options
Section titled “options”DeserializeSegmentedTrieJsonOptions<V>
Returns
Section titled “Returns”Throws
Section titled “Throws”When the serialized shape, a segment, or
a decoded value is invalid, or an entry repeats a key. Distinguish causes
with error.code, one of TrieParseErrorCode.
Call Signature
Section titled “Call Signature”deserializeSegmentedTrieJson(
serialized):SegmentedTrie<unknown>
Defined in: packages/trie/src/serialization/json.ts:209
Rebuild a segmented trie from a SerializedSegmentedTrie, restoring its recorded implementation unless a factory override is supplied. O(k) time for k stored segments.
Entries are replayed in serialized order, so a round trip through
serializeSegmentedTrieJson and deserializeSegmentedTrieJson preserves size,
iteration order, every stored value, and every longestPrefix answer.
Untyped input produces a SegmentedTrie<unknown>. Pass a value type guard
to validate decoded values and recover a narrower value type.
Parameters
Section titled “Parameters”serialized
Section titled “serialized”unknown
The trie to restore, either statically typed or decoded
as unknown.
Returns
Section titled “Returns”SegmentedTrie<unknown>
Throws
Section titled “Throws”When the serialized shape, a segment, or
a decoded value is invalid, or an entry repeats a key. Distinguish causes
with error.code, one of TrieParseErrorCode.