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
Section titled “Import”import { fromAny } from "@graphrefly/ts/sources";Signature
Section titled “Signature”function fromAny( input: NodeInput<T>, opts: NodeOptions<T> & { iter?: boolean } = {},): Node<T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input | NodeInput<T> | Input value to project or validate. |
opts | NodeOptions<T> & { iter?: boolean } | Options that configure the helper. |
Returns
Section titled “Returns”A Node
Example
Section titled “Example”import { fromAny } from "@graphrefly/ts/sources";Source
Section titled “Source”packages/ts/src/graph/sources.ts