MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / findStatementPath

Function findStatementPath

packages/parsers/src/gsapParser.ts:1362–1369  ·  view source on GitHub ↗

Walk up to the enclosing ExpressionStatement path (for prune / insertAfter).

(path: AstPath)

Source from the content-addressed store, hash-verified

1360
1361/** Walk up to the enclosing ExpressionStatement path (for prune / insertAfter). */
1362function findStatementPath(path: AstPath): AstPath | null {
1363 let p = path;
1364 while (p) {
1365 if (p.node?.type === "ExpressionStatement") return p;
1366 p = p.parentPath;
1367 }
1368 return null;
1369}
1370
1371function insertAfterAnchor(parsed: ParsedGsapAst, newStatement: AstNode): void {
1372 const lastCall = parsed.located[parsed.located.length - 1]?.call;

Callers 3

insertAfterAnchorFunction · 0.85
removeCallFromAstFunction · 0.85
insertInheritedStateSetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected