I tested the following code in the TypeScript AST Viewer:
const module = await import('./my-function.function');
It shows that this call expression is of type SyntaxKind.ImportKeyword, which isn't currently handled in convertFile.
This snippet could help detect it:
const initializer = declaration.getInitializerIfKind(SyntaxKind.AwaitExpression);
const callExpression = initializer?.getExpressionIfKind(SyntaxKind.CallExpression);
const importExpression = callExpression?.getExpressionIfKind(SyntaxKind.ImportKeyword);
Expected output:
const module = await import('./my-function.function.js');
I tested the following code in the TypeScript AST Viewer:
It shows that this call expression is of type
SyntaxKind.ImportKeyword, which isn't currently handled in convertFile.This snippet could help detect it:
Expected output: