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

x/rimbu/collection-types/set-custom/interface/base.ts>VariantSetBase.NonEmpty

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface VariantSetBase.NonEmpty
implements VariantSetBase<T, Tp>, [Streamable.NonEmpty]<T>
import { type VariantSetBase } from "https://deno.land/x/rimbu@1.0.3/collection-types/set-custom/interface/base.ts";
const { NonEmpty } = VariantSetBase;

Properties

readonly
isEmpty: false

Returns false since this collection is known to be non-empty

Methods

nonEmpty(): true

Returns true since this collection is know to be non-empty

assumeNonEmpty(): this

Returns a self reference since this collection is known to be non-empty.

asNormal(): WithElem<Tp, T>["normal"]

Returns this collection typed as a 'possibly empty' collection.

stream(): Stream.NonEmpty<T>

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

toArray(): ArrayNonEmpty<T>

Returns a non-empty array containing all values in this collection.