canonicalTopologyBytes()
Serialize a topology to canonical JSON bytes.
Import
Section titled “Import”import { canonicalTopologyBytes } from "@graphrefly/ts/graph";Signature
Section titled “Signature”function canonicalTopologyBytes(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): Uint8ArrayParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
snapshot | GraphTopologySnapshot | NormalizedGraphTopologySnapshot | Graph topology snapshot or normalized topology. |
Returns
Section titled “Returns”The canonical byte representation used for blueprint hashing.
Example
Section titled “Example”import { canonicalTopologyBytes } from "@graphrefly/ts/graph";
canonicalTopologyBytes({ nodes: [{ id: "source", factory: "state", deps: [] }], edges: [],});Source
Section titled “Source”packages/ts/src/graph/blueprint.ts