(value: unknown)
| 102 | |
| 103 | /** Check if a value is an AST node (has a valid `k` discriminant field). */ |
| 104 | export function isASTNode(value: unknown): value is ASTNode { |
| 105 | if (!value || typeof value !== "object" || Array.isArray(value)) return false; |
| 106 | return AST_KINDS.has((value as Record<string, unknown>).k as string); |
| 107 | } |
| 108 | |
| 109 | export function walkAST(node: ASTNode, visit: (node: ASTNode) => void): void { |
| 110 | const walk = (current: ASTNode) => { |
no test coverage detected