| 710 | } |
| 711 | |
| 712 | const 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 | |
| 730 | const toConfigCursorAST = memoize((root: SchemaAST.AST): SchemaAST.AST => { |
| 731 | const seen = new WeakSet<SchemaAST.AST>() |