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

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

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

Type Parameters

N
V
optional
Tp extends VariantValuedGraphBase.Types = VariantValuedGraphBase.Types

Properties

readonly
linkMap: WithGraphValues<Tp, N, V>["linkMapNonEmpty"]

Returns the nested non-empty Map representation of the graph connections.

Methods

stream(): Stream.NonEmpty<ValuedGraphElement<N, V>>

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

mapValues<V2>(mapFun: (
value: V,
node1: N,
node2: N,
) => V2
): WithGraphValues<Tp, N, V2>["nonEmpty"]

Returns a non-empty graph with the same connections, but where the given mapFun function is applied to each connection value.