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

x/rimbu/sorted/map-custom/implementation/builder.ts>SortedMapBuilder

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

Constructors

new
SortedMapBuilder(
context: SortedMapContext<K>,
source?: undefined | SortedMap<K, V>,
_entries?: undefined | (readonly [K, V])[],
_children?: undefined | SortedMapBuilder<K, V>[],
size?,
)

Properties

addEntries: (source: StreamSource<readonly [K, V]>) => boolean
addEntry: (entry: readonly [K, V]) => boolean
build: () => SortedMap<K, V>
buildMapValues: <V2>(f: (value: V, key: K) => V2) => SortedMap<K, V2>
children: SortedMapBuilder<K, V>[]
get: <UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>) => V | O
hasKey: <UK>(key: RelatedTo<K, UK>) => boolean
modifyAt: (key: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentValue: V, remove: Token) => V | Token; }) => boolean
removeKey: <UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>) => V | O
removeKeys: <UK>(keys: StreamSource<RelatedTo<K, UK>>) => boolean
set: (key: K, value: V) => boolean
updateAt: <O>(
key: K,
update: Update<V>,
otherwise?: OptLazy<O>,
) => V | O

Methods

addEntryInternal(entry: readonly [K, V]): boolean
createNew(
source?: undefined | SortedMap<K, V>,
_entries?: undefined | (readonly [K, V])[],
_children?: undefined | SortedMapBuilder<K, V>[],
size?: undefined | number,
): SortedMapBuilder<K, V>
modifyAtInternal(key: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentValue: V, remove: Token) => V | Token; }): boolean
removeInternal<O>(key: K, otherwise?: OptLazy<O>): V | O