Skip to content

Commit

Permalink
Merge pull request #14 from WIStudent/dynamicImport
Browse files Browse the repository at this point in the history
Detect dynamic imports
  • Loading branch information
mrjoelkemp committed Feb 4, 2019
2 parents 3ebdf3b + 36e3c87 commit f0ac400
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 f0ac400

Please sign in to comment.