Skip to content
Shapemetry

@huukhanhnguyen/model / core/graphSnapshot

core/graphSnapshot

assertEdgeTypes()

assertEdgeTypes(snapshot, registry?): GraphAssertResult

(b) every edge's type matches the consuming arg type — when registry is provided and consumer method is known. Edges without a matching arg are OK (structural dependents).

Parameters

snapshot

GraphSnapshot

registry?

Registry

Returns

GraphAssertResult


assertGraphClosed()

assertGraphClosed(snapshot, registry?): GraphAssertResult

Parameters

snapshot

GraphSnapshot

registry?

Registry

Returns

GraphAssertResult


assertNoCycle()

assertNoCycle(snapshot): GraphAssertResult

(a) no cycle — DFS; fails naming a cycle path.

Parameters

snapshot

GraphSnapshot

Returns

GraphAssertResult


assertReachableFromRoots()

assertReachableFromRoots(snapshot): GraphAssertResult

(c) every node reachable from a root (nodes with no inbound edge).

Parameters

snapshot

GraphSnapshot

Returns

GraphAssertResult


graphSnapshotOf()

graphSnapshotOf(source): GraphSnapshot

Build a snapshot from a Model-like source (nodes collection + optional registry). Edges come from live _dependents (dependOn / withEvaluating).

Parameters

source

GraphSnapshotSource

Returns

GraphSnapshot


snapshotToDot()

snapshotToDot(snapshot): string

Parameters

snapshot

GraphSnapshot

Returns

string


snapshotToMermaid()

snapshotToMermaid(snapshot): string

Parameters

snapshot

GraphSnapshot

Returns

string

Last updated: 📖 1 min readEdit on GitHub