StaticleavesThe key symbol that stores the leaves of any given node.
Insert an entry into the tree.
The string key for the entry.
The entry to store.
The node the entry was added to.
Return entries that match the given string prefix.
The prefix.
Optionaloptions: { filterEntries?: StringTreeEntryFilter; limit?: number } = {}Additional options to configure behaviour.
OptionalfilterEntries?: StringTreeEntryFilterA filter function to apply to each candidate entry.
Optionallimit?: numberThe maximum number of items to retrieve. It is important to set this value as very short prefixes will naturally match large numbers of entries.
A number of entries that have the given prefix.
Returns the node at the given prefix.
The prefix.
Protected_breadthProtectedPerform a breadth-first search starting from the given node and retrieving any entries reachable from that node, until we reach the limit.
The starting node.
The accumulated entries.
The working queue of nodes to search.
Optionaloptions: { filterEntries?: StringTreeEntryFilter; limit?: number } = {}OptionalfilterEntries?: StringTreeEntryFilterA filter function to apply to each candidate entry.
Optionallimit?: numberThe maximum number of entries to retrieve before stopping.
A data structure for quickly retrieving objects by a string prefix. Note that this works well for languages with alphabets (latin, cyrillic, korean, etc.), but may need more nuanced handling for languages that compose characters and letters.