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

x/rimbu/graph/custom/index.ts>ValuedGraphElement.getLinkElement

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function ValuedGraphElement.getLinkElement
import { ValuedGraphElement } from "https://deno.land/x/rimbu@1.0.0/graph/custom/index.ts";
const { getLinkElement } = ValuedGraphElement;

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.

Type Parameters

N
V
K extends keyof ValuedGraphElement<N, V>

Parameters

e: ValuedGraphElement<N, V>
  • the graph element
key: K
  • the link key

Returns

ValuedLink<N, V>[K] | undefined