Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/sorted/map-custom/implementation/immutable.ts>SortedMapNode

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class SortedMapNode
implements [SortedMap.NonEmpty]<K, V>
extends SortedNonEmptyBase<readonly [K, V], SortedMapNode<K, V>>
Abstract
import { SortedMapNode } from "https://deno.land/x/rimbu@1.0.4/sorted/map-custom/implementation/immutable.ts";

Properties

abstract
readonly
context: SortedMapContext<K>
abstract
readonly
size: number

Methods

addEntries(entries: StreamSource<readonly [K, V]>): SortedMap.NonEmpty<K, V>
addEntry(entry: readonly [K, V]): SortedMap.NonEmpty<K, V>
abstract
addInternal(entry: readonly [K, V], hash?: number): SortedMapNode<K, V>
asNormal(): this
drop(amount: number): SortedMap<K, V>
filter(pred: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => boolean
): SortedMap<K, V>
abstract
forEach(f: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => void
, traverseState?: TraverseState
): void
abstract
get<U, O>(key: RelatedTo<K, U>, otherwise?: OptLazy<O>): V | O
abstract
getInsertIndexOf(key: K): number
getKeyAtIndex<O>(index: number, otherwise?: OptLazy<O>): K | O
getSliceRange(range: Range<K>): { startIndex: number; endIndex: number; }
getValueAtIndex<O>(index: number, otherwise?: OptLazy<O>): V | O
hasKey<UK>(key: RelatedTo<K, UK>): boolean
abstract
mapValues<V2>(mapFun: (value: V, key: K) => V2): SortedMapNode<K, V2>
abstract
max(): readonly [K, V]
abstract
min(): readonly [K, V]
modifyAt(atKey: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentEntry: V, remove: Token) => V | Token; }): SortedMap<K, V>
abstract
modifyAtInternal(atKey: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentEntry: V, remove: Token) => V | Token; }): SortedMapNode<K, V>
abstract
normalize(): SortedMap<K, V>
removeKey<UK>(key: RelatedTo<K, UK>): SortedMap<K, V>
removeKeyAndGet<UK>(key: RelatedTo<K, UK>): [SortedMap<K, V>, V] | undefined
set(key: K, value: V): SortedMap.NonEmpty<K, V>
slice(range: Range<K>): SortedMap<K, V>
abstract
stream(reversed?: boolean): Stream.NonEmpty<readonly [K, V]>
streamKeys(reversed?: boolean): Stream.NonEmpty<K>
streamRange(keyRange: Range<K>, reversed?: boolean): Stream<readonly [K, V]>
abstract
streamSliceIndex(range: IndexRange, reversed?: boolean): Stream<readonly [K, V]>
streamValues(reversed?: boolean): Stream.NonEmpty<V>
take(amount: number): SortedMap<K, V> | any
abstract
toArray(): ArrayNonEmpty<readonly [K, V]>
toJSON(): ToJSON<(readonly [K, V])[]>
toString(): string
updateAt<U>(key: RelatedTo<K, U>, update: Update<V>): SortedMap.NonEmpty<K, V>