Walk up to the enclosing ExpressionStatement path (for prune / insertAfter).
(path: AstPath)
| 1360 | |
| 1361 | /** Walk up to the enclosing ExpressionStatement path (for prune / insertAfter). */ |
| 1362 | function 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 | |
| 1371 | function insertAfterAnchor(parsed: ParsedGsapAst, newStatement: AstNode): void { |
| 1372 | const lastCall = parsed.located[parsed.located.length - 1]?.call; |
no outgoing calls
no test coverage detected