Skip to content
PACKAGES

canonicalTopologyBytes()

Serialize a topology to canonical JSON bytes.

import { canonicalTopologyBytes } from "@graphrefly/ts/graph";
function canonicalTopologyBytes(snapshot: GraphTopologySnapshot | NormalizedGraphTopologySnapshot): Uint8Array
ParameterTypeDescription
snapshotGraphTopologySnapshot | NormalizedGraphTopologySnapshotGraph topology snapshot or normalized topology.

The canonical byte representation used for blueprint hashing.

import { canonicalTopologyBytes } from "@graphrefly/ts/graph";
canonicalTopologyBytes({
nodes: [{ id: "source", factory: "state", deps: [] }],
edges: [],
});

packages/ts/src/graph/blueprint.ts