MCPcopy Create free account
hub / github.com/Effect-TS/effect / graphEncodedSchema

Function graphEncodedSchema

packages/effect/src/Schema.ts:15587–15597  ·  view source on GitHub ↗
(
  type: T,
  node: Node,
  edge: Edge
)

Source from the content-addressed store, hash-verified

15585 readonly edge: Edge
15586}
15587function graphEncodedSchema<T extends Graph_.Kind, Node extends Constraint, Edge extends Constraint>(
15588 type: T,
15589 node: Node,
15590 edge: Edge
15591) {
15592 return Struct({
15593 type: Literal(type),
15594 nodes: ArraySchema(Struct({ index: Natural, data: node })),
15595 edges: ArraySchema(Struct({ index: Natural, source: Natural, target: Natural, data: edge }))
15596 })
15597}
15598function graphDecode<N, E, T extends Graph_.Kind>(
15599 input: EncodedGraph<N, E, T>,
15600 options: SchemaAST.ParseOptions

Callers 1

GraphFunction · 0.85

Calls 2

StructFunction · 0.70
LiteralFunction · 0.70

Tested by

no test coverage detected