Skip to content

Commit

Permalink
Detect dynamic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
WIStudent committed Feb 2, 2019
1 parent 3ebdf3b commit 36e3c87
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ module.exports.isREMForm = function(node) {

module.exports.isES6Import = function(node) {
switch(node.type) {
case 'Import':
case 'ImportDeclaration':
case 'ImportDefaultSpecifier':
case 'ImportNamespaceSpecifier':
Expand Down
1 change: 1 addition & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ describe('module-types', function() {
assert(check('import * as foo from "mod.js";', types.isES6Import, true));
assert(check('import "mylib2";', types.isES6Import, true));
assert(check('import foo from "mod.js";', types.isES6Import, true));
assert(check('import("foo");', types.isES6Import, true));
});

it('detects es6 exports', function () {
Expand Down

0 comments on commit 36e3c87

Please sign in to comment.