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

x/rimbu/graph/custom/common/link.ts

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
import * as rimbu from "https://deno.land/x/rimbu@0.13.5/graph/custom/common/link.ts";

Functions

Returns the values of the link graph element if the given element e is a Link element, or undefined otherwise.

Returns the element at the given key in the graph element e, if the element is a Link element, or returns the given otherwise value otherwise.

Returns the value of a single node graph element if the given element e is a single node, or the given otherwise fallback value otherwise.

Returns true if the given graph element e is a 2-tuple. Instructs the compiler that the type is a 2-tuple.

Returns true if the given graph element e is a single node. Instructs the compiler that the type is a 1-tuple.

Returns a graph Link from the given node1 and node2 nodes.

Returns a graph Link from the given 2-tuple tuple.

Returns the given potentially valued link link as a 2-tuple

Type Aliases

A graph element is either an isolated node as a 1-tuple, or a link between nodes represented as a Link instance.

A potentially valued connection between two nodes, being a 2-valued or 3-valued tuple of which the first two elements are nodes