| 4684 | } |
| 4685 | |
| 4686 | function extractStructuralChecks(checks: Checks): Checks | undefined { |
| 4687 | function extract(check: Check<any>): Array<Check<any>> { |
| 4688 | if (isStructuralCheck(check)) return [check] |
| 4689 | return check._tag === "FilterGroup" ? check.checks.flatMap(extract) : [] |
| 4690 | } |
| 4691 | const out = checks.flatMap(extract) |
| 4692 | return Arr.isArrayNonEmpty(out) ? out : undefined |
| 4693 | } |
| 4694 | |
| 4695 | // Suspensions are leaves in this walk. Only resolving a suspension may call its thunk. |
| 4696 | function everyNode(root: AST, predicate: (ast: AST) => boolean, proven?: WeakSet<AST>): boolean { |