(call: Node)
| 1009 | |
| 1010 | // e.g. `export default configure(...)` |
| 1011 | export const runsOnceAtLoad = (call: Node): boolean => { |
| 1012 | let statement = operatorOf(call)[1] |
| 1013 | if (statement?.type === "UnaryExpression" && statement.operator === "void") |
| 1014 | statement = operatorOf(statement)[1] |
| 1015 | if (statement?.type === "VariableDeclarator") statement = statement.parent |
| 1016 | if (statement?.parent?.type === "ExportNamedDeclaration") |
| 1017 | statement = statement.parent |
| 1018 | return ( |
| 1019 | statement?.parent?.type === "Program" && |
| 1020 | (statement.type === "ExpressionStatement" || |
| 1021 | statement.type === "VariableDeclaration" || |
| 1022 | statement.type === "ExportNamedDeclaration" || |
| 1023 | statement.type === "ExportDefaultDeclaration") |
| 1024 | ) |
| 1025 | } |
| 1026 | |
| 1027 | // e.g. "./a.ts" for `import("./a.ts")`, `require("./a.ts")` or `import a = require("./a.ts")` |
| 1028 | export const loadedSpecifierOf = (node: Node): unknown => { |
no test coverage detected