GraphReFlyTS

API Reference

fromAny()

Coerce a {@link NodeInput}<T> to a Node<T> (D43 — coercion prerequisite for the CSP-2.7 higher-order operators). An existing Node passes through; a thenable → {@link fromPromise}; an async iterable → {@link fromAsyncIter}; with {iter:true} a sync iterable → {@link fromIter}; everything else → {@link of}. Coerced nodes are bare (use opts.dispatcher to bind one, default = process-global D26).

Import

import { fromAny } from "@graphrefly/ts/sources";

Signature

function fromAny(
	input: NodeInput<T>,
	opts: NodeOptions<T> & { iter?: boolean } = {},
): Node<T>

Parameters

ParameterTypeDescription
inputNodeInput<T>Input value to project or validate.
optsNodeOptions<T> & { iter?: boolean }Options that configure the helper.

Returns

A Node<T> value for the boundary or adapter.

Example

import { fromAny } from "@graphrefly/ts/sources";

Source

packages/ts/src/graph/sources.ts