import { type SortedMap } from "https://deno.land/x/rimbu@0.13.1/core/mod.ts";
const { NonEmpty } = SortedMap;
A non-empty type-invariant immutable Map of key type K, and value type V. In the Map, each key has exactly one value, and the Map cannot contain duplicate keys. See the Map documentation and the SortedMap API documentation
Examples
Example 1
Example 1
const m1 = SortedMap.empty<number, string>()
const m2 = SortedMap.of([1, 'a'], [2, 'b'])
Methods
stream(reversed?: boolean): Stream.NonEmpty<readonly [K, V]>
streamKeys(reversed?: boolean): Stream.NonEmpty<K>
streamValues(reversed?: boolean): Stream.NonEmpty<V>
minKey(): K
Returns the minimum key of the SortedMap.
minValue(): V
Returns the value associated with the minimum key of the SortedMap.
maxKey(): K
Returns the maximum key of the SortedMap.
maxValue(): V
Returns the value associated with the maximum key of the SortedMap.