MCPcopy
hub / github.com/lingodotdev/lingo.dev / _getProgramNodePath

Function _getProgramNodePath

packages/compiler/src/utils/ast-key.ts:59–70  ·  view source on GitHub ↗
(ast: t.File)

Source from the content-addressed store, hash-verified

57}
58
59function _getProgramNodePath(ast: t.File): NodePath<t.Program> | null {
60 let result: NodePath<t.Program> | null = null;
61
62 traverse(ast, {
63 Program(nodePath: NodePath<t.Program>) {
64 result = nodePath;
65 nodePath.stop();
66 },
67 });
68
69 return result;
70}

Callers 1

getAstByKeyFunction · 0.85

Calls 1

traverseFunction · 0.50

Tested by

no test coverage detected