fix(sdk): scan template literal imports
This commit is contained in:
@@ -211,7 +211,7 @@ function extractImports(source, file) {
|
||||
const visit = (node) => {
|
||||
if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node))
|
||||
&& node.moduleSpecifier
|
||||
&& ts.isStringLiteral(node.moduleSpecifier)) {
|
||||
&& ts.isStringLiteralLike(node.moduleSpecifier)) {
|
||||
imports.push({
|
||||
specifier: node.moduleSpecifier.text,
|
||||
bindings: ts.isImportDeclaration(node) && node.importClause
|
||||
@@ -221,13 +221,13 @@ function extractImports(source, file) {
|
||||
}
|
||||
if (ts.isImportTypeNode(node)
|
||||
&& ts.isLiteralTypeNode(node.argument)
|
||||
&& ts.isStringLiteral(node.argument.literal)) {
|
||||
&& ts.isStringLiteralLike(node.argument.literal)) {
|
||||
imports.push({ specifier: node.argument.literal.text, bindings: '' });
|
||||
}
|
||||
if (ts.isCallExpression(node)
|
||||
&& node.expression.kind === ts.SyntaxKind.ImportKeyword
|
||||
&& node.arguments.length === 1
|
||||
&& ts.isStringLiteral(node.arguments[0])) {
|
||||
&& ts.isStringLiteralLike(node.arguments[0])) {
|
||||
imports.push({ specifier: node.arguments[0].text, bindings: '' });
|
||||
}
|
||||
ts.forEachChild(node, visit);
|
||||
|
||||
Reference in New Issue
Block a user