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

Function decodeFromCursor

packages/effect/src/Config.ts:675–686  ·  view source on GitHub ↗
(
  ast: SchemaAST.AST,
  decode: (cursor: ConfigCursor) => Effect.Effect<unknown, SchemaIssue.Issue>
)

Source from the content-addressed store, hash-verified

673 loadCursor(cursor.provider, [...cursor.path, segment])
674
675const decodeFromCursor = (
676 ast: SchemaAST.AST,
677 decode: (cursor: ConfigCursor) => Effect.Effect<unknown, SchemaIssue.Issue>
678): SchemaAST.AST =>
679 SchemaAST.decodeTo(
680 SchemaAST.unknown,
681 ast,
682 new SchemaTransformation.Transformation(
683 SchemaGetter.transformEffect((input: unknown) => decode(input as ConfigCursor)),
684 SchemaGetter.passthrough()
685 )
686 )
687
688const isScalarInput = (ast: SchemaAST.AST): boolean => {
689 switch (ast._tag) {

Callers 1

Config.tsFile · 0.85

Calls 1

decodeFunction · 0.70

Tested by

no test coverage detected