Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/rimbu/graph/custom/index.ts>VariantGraphBase.NonEmpty

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

Properties

readonly
isEmpty: false

Returns false since the graph is known to be non-empty.

Methods

nonEmpty(): true

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

asNormal(): WithGraphValues<Tp, N, V>["normal"]

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

stream(): Stream.NonEmpty<[N] | WithGraphValues<Tp, N, V>["link"]>

Returns a non-empty Stream containing all graph elements of this collection as single tuples for isolated nodes and 2-valued tuples of nodes for connections.

streamNodes(): Stream.NonEmpty<N>

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