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

Function hasProviderInput

packages/effect/src/Config.ts:712–728  ·  view source on GitHub ↗
(
  ast: SchemaAST.AST,
  node: ConfigProvider.Node | undefined
)

Source from the content-addressed store, hash-verified

710}
711
712const hasProviderInput = (
713 ast: SchemaAST.AST,
714 node: ConfigProvider.Node | undefined
715): boolean => {
716 switch (ast._tag) {
717 case "Objects":
718 return node?._tag === "Record"
719 case "Arrays":
720 return node?._tag === "Array"
721 case "Union":
722 return ast.types.some((ast) => hasProviderInput(ast, node))
723 case "Suspend":
724 return hasProviderInput(ast.thunk(), node)
725 default:
726 return getScalar(node) !== undefined
727 }
728}
729
730const toConfigCursorAST = memoize((root: SchemaAST.AST): SchemaAST.AST => {
731 const seen = new WeakSet<SchemaAST.AST>()

Callers 1

schemaFunction · 0.85

Calls 2

getScalarFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected