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

x/rimbu/bimap/custom/index.ts>BiMapNonEmptyImpl

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
class BiMapNonEmptyImpl
implements [BiMap.NonEmpty]<K, V>
extends NonEmptyBase<readonly [K, V]>
Re-export
import { BiMapNonEmptyImpl } from "https://deno.land/x/rimbu@1.0.3/bimap/custom/index.ts";

Constructors

new
BiMapNonEmptyImpl(
context: BiMapContext<K, V>,
keyValueMap: RMap.NonEmpty<K, V>,
valueKeyMap: RMap.NonEmpty<V, K>,
)

Properties

readonly
size: number

Methods

addEntries(entries: StreamSource<readonly [K, V]>): BiMap.NonEmpty<K, V>
addEntry(entry: readonly [K, V]): BiMap.NonEmpty<K, V>
asNormal(): this
copy(keyValueMap?, valueKeyMap?): BiMap.NonEmpty<K, V>
copyE(keyValueMap?: RMap<K, V>, valueKeyMap?: RMap<V, K>): BiMap<K, V>
filter(pred: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => boolean
): BiMap<K, V>
forEach(f: (
entry: readonly [K, V],
index: number,
halt: () => void,
) => void
, state?: TraverseState
): void
getKey<UV, O>(value: RelatedTo<V, UV>, otherwise?: OptLazy<O>): K | O
getValue<UK, O>(key: RelatedTo<K, UK>, otherwise?: OptLazy<O>): V | O
hasKey<UK>(key: RelatedTo<K, UK>): boolean
hasValue<UV>(value: RelatedTo<V, UV>): boolean
removeKey<UK>(key: RelatedTo<K, UK>): BiMap<K, V>
removeKeyAndGet<UK>(key: RelatedTo<K, UK>): [BiMap<K, V>, V] | undefined
removeKeys<UK>(keys: Stream<RelatedTo<K, UK>>): BiMap<K, V>
removeValue<UV>(value: RelatedTo<V, UV>): BiMap<K, V>
removeValueAndGet<UV>(value: RelatedTo<V, UV>): [BiMap<K, V>, K] | undefined
removeValues<UV>(values: Stream<RelatedTo<V, UV>>): BiMap<K, V>
set(key: K, value: V): BiMap.NonEmpty<K, V>
stream(): Stream.NonEmpty<readonly [K, V]>
streamKeys(): Stream.NonEmpty<K>
streamValues(): Stream.NonEmpty<V>
toArray(): ArrayNonEmpty<readonly [K, V]>
toBuilder(): BiMap.Builder<K, V>
toJSON(): ToJSON<(readonly [K, V])[], this["context"]["typeTag"]>
toString(): string
updateKeyAtValue(keyUpdate: Update<K>, value: V): BiMap.NonEmpty<K, V>
updateValueAtKey(key: K, valueUpdate: Update<V>): BiMap.NonEmpty<K, V>