UNPKG

@typed/test

Version:
13 lines 393 B
import { forEachChild, SyntaxKind } from 'typescript'; export function traverseNode(f, seed, sourceFile) { let acc = seed; visitChildren(sourceFile); return acc; function visitChildren(node) { if (node.kind !== SyntaxKind.SourceFile) { acc = f(acc, node); } forEachChild(node, visitChildren); } } //# sourceMappingURL=traverseNode.js.map