(node: CallExpression)
| 92 | } |
| 93 | |
| 94 | function findImportMetaResolve(node: CallExpression) { |
| 95 | const source = node.arguments[0]; |
| 96 | if (!isImportMetaResolve(node) || !isStringLiteral(source)) return; |
| 97 | const name = decodeURI(getStringLiteralValue(source)); |
| 98 | if (isPathImport(name)) { |
| 99 | const localPath = resolveLocalPath(path, name); |
| 100 | if (!localPath) throw syntaxError(`non-local import: ${name}`, node, input); // prettier-ignore |
| 101 | addImport({name: relativePath(path, localPath), type: "local", method: "resolve"}); |
| 102 | } else { |
| 103 | addImport({name, type: "global", method: "resolve"}); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | return imports; |
| 108 | } |
nothing calls this directly
no test coverage detected