Optional
keyFromEntry: ((entry) => TKey) = ...a function to extract the key from an entry. The default assumes the key is the entry itself.
Optional
compare: ((a, b) => number) = ...a comparison function for keys. The default uses < and > operators.
Private
_rootPrivate
_versionPrivate
Readonly
comparea comparison function for keys. The default uses < and > operators.
Private
Readonly
keya function to extract the key from an entry. The default assumes the key is the entry itself.
Private
branchProtected
compareInvokes user-provided comperator to compare two keys. Inner-loop code, so this doesn't do backflips to iron out ES's idiosyncrasies (undefined quirks, infinity, nulls, etc.), but does ensure deterministic comparison. If you want to eak out more performance at the risk of corruption, you can override this method and omit the consistency check.
Private
findPrivate
findPrivate
getPrivate
getPrivate
getPrivate
indexPrivate
indexPrivate
internalPrivate
internalPrivate
internalPrivate
internalPrivate
internalPrivate
internalPrivate
internalPrivate
internalPrivate
leafInserts or updates depending on the existence of the given key, using callbacks to generate the new value.
path to new entry and whether an update or insert attempted. If getUpdated callback returns a row that is already present, the resulting path will not be on.
Private
movePrivate
movePrivate
rebalancePrivate
rebalanceUpdates the entry at the given path to the given value. Deletes and inserts if the key changes.
path to resulting entry and whether it was an update (as opposed to an insert). * on = true if update/insert succeeded. * wasUpdate = true if updated; false if inserted. * Returned path is on entry * on = false if update/insert failed. * wasUpdate = true, given path is not on an entry * else newEntry's new key already present; returned path is "near" existing entry
Private
updatePrivate
validateGenerated using TypeDoc
Represents a lightweight B+(ish)Tree (data at leaves, but no linked list of leaves). Allows for efficient storage and retrieval of data in a sorted manner.