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

x/rimbu/core/mod.ts>SortedSet.Builder

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface SortedSet.Builder
implements [RSetBase.Builder]<T, SortedSet.Types>
import { type SortedSet } from "https://deno.land/x/rimbu@1.2.0/core/mod.ts";
const { Builder } = SortedSet;

A mutable SortedSet builder used to efficiently create new immutable instances. See the Set documentation and the SortedSet.Builder API documentation

Methods

min(): T | undefined

Returns the minimum value of the SortedSet builder, or a fallback value (default: undefined) if the builder is empty.

min<O>(otherwise: OptLazy<O>): T | O
max(): T | undefined

Returns the maximum value of the SortedSet builder, or a fallback value (default: undefined) if the builder is empty.

max<O>(otherwise: OptLazy<O>): T | O
getAtIndex(index: number): T | undefined

Returns the value at the given index of the value sort order of the SortedSet builder, or a fallback value (default: undefined) if the index is out of bounds.

getAtIndex<O>(index: number, otherwise: OptLazy<O>): T | O