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

x/rimbu/proximity/map-custom/implementation/index.ts>ProximityMapNonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class ProximityMapNonEmpty
implements [ProximityMap.NonEmpty]<K, V>
import { ProximityMapNonEmpty } from "https://deno.land/x/rimbu@1.0.0/proximity/map-custom/implementation/index.ts";

Constructors

new
ProximityMapNonEmpty(context: ProximityMap.Context<K>, internalMap: HashMap.NonEmpty<K, V>)

Properties

readonly
isEmpty: boolean
readonly
size: number

Methods

private
plugInternalMap(newInternalMap: HashMap.NonEmpty<K, V>): ProximityMap.NonEmpty<K, V>
private
plugInternalMap(newInternalMap: HashMap<K, V>): ProximityMap<K, V>
addEntries(entries: StreamSource<readonly [K, V]>): ProximityMap.NonEmpty<K, V>
addEntry(entry: readonly [K, V]): ProximityMap.NonEmpty<K, V>
filter(pred: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => boolean
): ProximityMap<K, V>
forEach(f: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => void
, state?: TraverseState | undefined
): void
get<UK = K>(key: RelatedTo<K, UK>): V | undefined

Applies getValueWithNearestKey() to its entries

get<UK, O>(key: RelatedTo<K, UK>, otherwise: OptLazy<O>): V | O
hasKey<UK = K>(key: RelatedTo<K, UK>): boolean
mapValues<V2>(mapFun: (value: V, key: K) => V2): ProximityMap.NonEmpty<K, V2>
modifyAt(atKey: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: <V2 extends V = V>(currentEntry: V & V2, remove: Token) => V | Token; }): ProximityMap<K, V>
nonEmpty(): true
removeKey<UK = K>(key: RelatedTo<K, UK>): ProximityMap<K, V>
removeKeyAndGet<UK = K>(key: RelatedTo<K, UK>): [ProximityMap<K, V>, V] | undefined
set(key: K, value: V): ProximityMap.NonEmpty<K, V>
stream(): Stream.NonEmpty<readonly [K, V]>
streamKeys(): Stream.NonEmpty<K>
streamValues(): Stream.NonEmpty<V>
toArray(): ArrayNonEmpty<readonly [K, V]>
toBuilder(): ProximityMap.Builder<K, V>
toJSON(): ToJSON<(readonly [K, V])[], string>
toString(): string
updateAt<UK = K>(key: RelatedTo<K, UK>, update: RMapBase.Update<V>): ProximityMap.NonEmpty<K, V>