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

x/rimbu/core/mod.ts>SortedMultiMapSortedValue.NonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface SortedMultiMapSortedValue.NonEmpty
implements [MultiMapBase.NonEmpty]<K, V, SortedMultiMapSortedValue.Types>, Omit<SortedMultiMapSortedValue<K, V>, keyof MultiMapBase.NonEmpty<any, any, any>>, [Streamable.NonEmpty]<[K, V]>
import { type SortedMultiMapSortedValue } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { NonEmpty } = SortedMultiMapSortedValue;

A non-empty type-invariant immutable MultiMap of key type K, and value type V. In the MultiMap, each key has at least one value. See the MultiMap documentation and the SortedMultiMapSortedValue API documentation

Examples

Example 1

const m1 = SortedMultiMapSortedValue.empty<number, string>()
const m2 = SortedMultiMapSortedValue.of([1, 'a'], [1, 'b'], [2, 'a'])

Methods

stream(): Stream.NonEmpty<[K, V]>