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

Function graphEncode

packages/effect/src/Schema.ts:15650–15659  ·  view source on GitHub ↗
(
  input: Graph_.Graph<N, E, T>,
  type: T,
  options: SchemaAST.ParseOptions
)

Source from the content-addressed store, hash-verified

15648 return Effect.succeed(InternalGraph.hydrate(input))
15649}
15650function graphEncode<N, E, T extends Graph_.Kind>(
15651 input: Graph_.Graph<N, E, T>,
15652 type: T,
15653 options: SchemaAST.ParseOptions
15654): Effect.Effect<EncodedGraph<N, E, T>, SchemaIssue.Issue> {
15655 if (!InternalGraph.isGraph(input) || input.mutable || input.type !== type) {
15656 return Effect.fail(new SchemaIssue.InvalidValue({ expected: `an immutable ${type} Graph` }, input, options))
15657 }
15658 return Effect.succeed(InternalGraph.snapshot(input))
15659}
15660function graphToEquivalence<N, E, T extends Graph_.Kind>(
15661 node: Equivalence.Equivalence<N>,
15662 edge: Equivalence.Equivalence<E>

Callers 1

GraphFunction · 0.85

Calls 3

failMethod · 0.65
succeedMethod · 0.45
snapshotMethod · 0.45

Tested by

no test coverage detected