import { BiMap } from "https://deno.land/x/rimbu@1.0.3/bimap/mod.ts";
Interfaces
A mutable | |
The BiMap's Context instance that serves as a factory for all related immutable instances and builders. | |
A non-empty type-invariant immutable bi-directional Map where keys and values have a one-to-one mapping. See the BiMap documentation and the BiMap API documentation * @typeparam K - the key type | |
Utility interface that provides higher-kinded types for this collection. |
import { type BiMap } from "https://deno.land/x/rimbu@1.0.3/bimap/mod.ts";
A type-invariant immutable bi-directional Map where keys and values have a one-to-one mapping. See the BiMap documentation and the BiMap API documentation
Examples
Example 1
Example 1
const b1 = BiMap.empty<number, string>()
const b2 = BiMap.of([1, 'a'], [2, 'b'])
Properties
Returns the context
associated to this collection instance.
Methods
Returns true if there is at least one entry in the collection, and instructs the compiler to treat the collection as a .NonEmpty type.
Returns the collection as a .NonEmpty type
Returns true if the given key
is present in the collection.
Returns true if the given value
is present in the collection.
Returns the value associated with the given key
, or given otherwise
value if the key is not in the collection.
Returns the key associated with the given value
, or given otherwise
value if the key is not in the collection.
Returns the collection with the given key
associated to the given value
.
Returns the collection with given entry
added.
Returns the collection with the entries from the given StreamSource
entries
added.
Returns the collection where the entry associated with given key
is removed if it was part of the collection.
Returns a tuple containing the collection of which the entry associated with given key
is removed, and the value that
is associated with that key. If the key is not present, it will return undefined instead.
Returns the collection where the entries associated with each key in given keys
are removed if they were present.
Returns the collection where the entry associated with given value
is removed if it was part of the collection.
Returns a tuple containing the collection of which the entry associated with given value
is removed, and the key that
is associated with that value. If the value is not present, it will return undefined instead.
Returns the collection where the entries associated with each value in given values
are removed if they were present.
Returns the collection where the value associated with given key
is updated with the given valueUpdate
value or update function.
Returns the collection where the key associated with given value
is updated with the given keyUpdate
value or update function.
Returns a Stream
containing all entries of this collection as tuples of key and value.
Performs given function f
for each entry of the collection, using given state
as initial traversal state.
Returns a collection containing only those entries that satisfy given pred
predicate.
Returns a builder object containing the entries of this collection.
import { BiMap } from "https://deno.land/x/rimbu@1.0.3/bimap/mod.ts";