( ast: SchemaAST.AST, seen: Set<SchemaAST.AST> = new Set() )
| 2413 | * since only its guard could say. A `suspend` is followed, once. |
| 2414 | */ |
| 2415 | const namesUndefined = ( |
| 2416 | ast: SchemaAST.AST, |
| 2417 | seen: Set<SchemaAST.AST> = new Set() |
| 2418 | ): boolean => { |
| 2419 | switch (ast._tag) { |
| 2420 | case "Undefined": |
| 2421 | case "Void": |
| 2422 | case "Unknown": |
| 2423 | case "Any": |
| 2424 | return true |
| 2425 | case "Union": |
| 2426 | return ast.types.some((type) => namesUndefined(type, seen)) |
| 2427 | case "Suspend": { |
| 2428 | if (seen.has(ast)) return false |
| 2429 | seen.add(ast) |
| 2430 | return namesUndefined(ast.thunk(), seen) |
| 2431 | } |
| 2432 | default: |
| 2433 | return false |
| 2434 | } |
| 2435 | } |
| 2436 | |
| 2437 | /** |
| 2438 | * A copy of `o` without the named properties. Every other own property keeps |
no test coverage detected