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

x/rimbu/core/menu/set/index.ts>Sorted.NonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface Sorted.NonEmpty
implements [RSetBase.NonEmpty]<T, SortedSet.Types>, Omit<SortedSet<T>, keyof RSetBase.NonEmpty<any, any>>, [Streamable.NonEmpty]<T>
import { type Sorted } from "https://deno.land/x/rimbu@1.0.2/core/menu/set/index.ts";
const { NonEmpty } = Sorted;

A non-empty type-invariant immutable Set of value type T. In the Set, there are no duplicate values. See the Set documentation and the SortedSet API documentation

Examples

Example 1

const s1 = SortedSet.empty<string>()
const s2 = SortedSet.of('a', 'b', 'c')

Methods

stream(reversed?: boolean): Stream.NonEmpty<T>
min(): T

Returns the minimum value of the SortedSet.

max(): T

Returns the maximum value of the SortedSet.

take<N extends number>(amount: N): 0 extends N ? SortedSet<T> : SortedSet.NonEmpty<T>