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

x/rimbu/ordered/map-custom/implementation/non-empty.ts>OrderedMapNonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class OrderedMapNonEmpty
implements [OrderedMapBase.NonEmpty]<K, V, Tp>
extends NonEmptyBase<[K, V]>
import { OrderedMapNonEmpty } from "https://deno.land/x/rimbu@0.13.5/ordered/map-custom/implementation/non-empty.ts";

Constructors

new
OrderedMapNonEmpty(
context: TpG["context"],
keyOrder: List.NonEmpty<K>,
sourceMap: TpG["sourceMapNonEmpty"],
)

Type Parameters

K
V
optional
Tp extends OrderedMapTypes = OrderedMapTypes
optional
TpG extends WithKeyValue<Tp, K, V> = WithKeyValue<Tp, K, V>

Properties

readonly
isEmpty: false
readonly
size: number

Methods

addEntries(entries: StreamSource<readonly [K, V]>): OrderedMapBase<K, V, Tp> | any
addEntry(entry: readonly [K, V]): WithKeyValue<Tp, K, V>["nonEmpty"]
asNormal(): any
copy(keyOrder?, sourceMap?): TpG["nonEmpty"]
filter(pred: (
entry: [K, V],
index: number,
halt: () => void,
) => boolean
): TpG["normal"]
forEach(f: (
entry: [K, V],
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
get<UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>): V | O
hasKey<UK>(key: RelatedTo<K, UK>): boolean
mapValues<V2>(mapFun: (value: V, key: K) => V2): any
modifyAt(key: K, options: { ifNew?: OptLazyOr<V, Token>; ifExists?: (currentValue: V, remove: Token) => V | Token; }): TpG["normal"]
nonEmpty(): true
removeKey<UK>(key: RelatedTo<K, UK>): TpG["normal"]
removeKeyAndGet<UK>(key: RelatedTo<K, UK>): [TpG["normal"], V] | undefined
removeKeys<UK>(keys: StreamSource<RelatedTo<K, UK>>): TpG["normal"]
set(key: K, value: V): WithKeyValue<Tp, K, V>["nonEmpty"]
stream(): Stream.NonEmpty<[K, V]>
streamKeys(): Stream.NonEmpty<K>
streamValues(): Stream.NonEmpty<V>
toBuilder(): TpG["builder"]
toJSON(): ToJSON<(readonly [K, V])[]>
toString(): string
updateAt<UK>(key: RelatedTo<K, UK>, update: Update<V>): any