Skip to main content
Module

x/rimbu/multiset/custom/index.ts>MultiSetBase.NonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface MultiSetBase.NonEmpty
implements [VariantMultiSetBase.NonEmpty]<T, Tp>, Omit<MultiSetBase<T, Tp>, keyof VariantMultiSetBase.NonEmpty<any, any>>, [Streamable.NonEmpty]<T>
import { type MultiSetBase } from "https://deno.land/x/rimbu@0.13.1/multiset/custom/index.ts";
const { NonEmpty } = MultiSetBase;

Methods

stream(): Stream.NonEmpty<T>

Returns a non-empty Stream containing all values of this collection.

add(value: T, amount?: number): WithElem<Tp, T>["nonEmpty"]

Returns the collection with the given value added amount times.

addAll(values: StreamSource<T>): WithElem<Tp, T>["nonEmpty"]

Returns the collection with the values in values added.

addEntries(entries: StreamSource<readonly [T, number]>): WithElem<Tp, T>["nonEmpty"]

Returns the collection where for every entry in entries consisting of a tuple of a value and an amount, that value is added amount times.