Skip to content

Commit

Permalink
fix(ts-transform-paths): moduleSpecifier null check #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Marty Mcfly committed May 31, 2019
1 parent 9ab4df8 commit 50c033c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
},
{
"type": "node",
"request": "launch",
"name": "Jest Current File",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--config",
"jest.config.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
}
}
]
}
2 changes: 1 addition & 1 deletion packages/ts-transform-paths/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function importPathVisitor(
importValue = arg.getText()
nodeToFix = arg
} else if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
if (!ts.isStringLiteral(node.moduleSpecifier)) return
if (!node.moduleSpecifier || !ts.isStringLiteral(node.moduleSpecifier)) return
// do not use getFullText() here, bug in watch mode, https://github.com/zerkalica/zerollup/issues/12
importValue = `"${node.moduleSpecifier.text}"`
nodeToFix = node.moduleSpecifier
Expand Down

0 comments on commit 50c033c

Please sign in to comment.