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

x/rimbu/table/custom/interface/base.ts>VariantTableBase.NonEmpty

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

Properties

readonly
rowMap: WithRow<Tp, R, C, V>["rowMapNonEmpty"]

Returns the Map representation of this collection.

readonly
isEmpty: false

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

Methods

assumeNonEmpty(): this

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

asNormal(): WithRow<Tp, R, C, 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<[R, C, V]>

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

streamRows(): Stream.NonEmpty<R>

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

streamValues(): Stream.NonEmpty<V>

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

mapValues<V2>(mapFun: (
value: V,
row: R,
column: C,
) => V2
): (Tp & Row<R, C, V2>)["nonEmpty"]

Returns a non-empty collection with the same row and column keys, but where the given mapFun function is applied to each entry value.

toArray(): ArrayNonEmpty<[R, C, V]>

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