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

Function decodeFromCursor

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

Source from the content-addressed store, hash-verified

684const getScalar = (node: ConfigProvider.Node | undefined): string | undefined => node?.value
685
686const decodeFromCursor = (
687 ast: SchemaAST.AST,
688 decode: (cursor: ConfigCursor) => Effect.Effect<unknown, SchemaIssue.Issue>
689): SchemaAST.AST =>
690 SchemaAST.decodeTo(
691 SchemaAST.unknown,
692 ast,
693 new SchemaTransformation.Transformation(
694 SchemaGetter.transformOrFail((input: unknown) => decode(input as ConfigCursor)),
695 SchemaGetter.passthrough()
696 )
697 )
698
699const isScalarInput = (ast: SchemaAST.AST): boolean => {
700 switch (ast._tag) {

Callers 1

Config.tsFile · 0.85

Calls 1

decodeFunction · 0.70

Tested by

no test coverage detected