| 699 | } |
| 700 | |
| 701 | const hasProviderInput = ( |
| 702 | ast: SchemaAST.AST, |
| 703 | node: ConfigProvider.Node | undefined |
| 704 | ): boolean => { |
| 705 | switch (ast._tag) { |
| 706 | case "Objects": |
| 707 | return node?._tag === "Record" |
| 708 | case "Arrays": |
| 709 | return node?._tag === "Array" |
| 710 | case "Union": |
| 711 | return ast.types.some((ast) => hasProviderInput(ast, node)) |
| 712 | case "Suspend": |
| 713 | return hasProviderInput(ast.thunk(), node) |
| 714 | default: |
| 715 | return node?.value !== undefined |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | const toConfigCursorAST = memoize((root: SchemaAST.AST): SchemaAST.AST => { |
| 720 | const seen = new WeakSet<SchemaAST.AST>() |