Skip to main content
Module

x/rimbu/multimap/custom/index.ts>VariantMultiMapBase.NonEmpty

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

Properties

readonly
isEmpty: false

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

readonly
keyMap: WithKeyValue<Tp, K, V>["keyMapNonEmpty"]

Returns the non-empty Map representation of this collection.

Methods

assumeNonEmpty(): this

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

asNormal(): WithKeyValue<Tp, K, V>["normal"]

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

nonEmpty(): true

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

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

Returns a non-empty Stream containing all entries of this collection as tuples of key and value.

streamKeys(): Stream.NonEmpty<K>

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

streamValues(): Stream.NonEmpty<V>

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

toArray(): ArrayNonEmpty<[K, V]>

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