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

x/rimbu/ordered/mod.ts>OrderedSortedMap.NonEmpty

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

A non-empty type-invariant immutable Ordered SortedMap 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 OrderedSortedMap API documentation

Examples

Example 1

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

Methods

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