ast-module-types
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -205,1 +205,5 @@ // Whether or not the node represents an AMD define() call | ||
}; | ||
module.exports.isDynamicImport = function(node) { | ||
return node.callee && node.callee.type === 'Import' && node.arguments.length; | ||
}; |
{ | ||
"name": "ast-module-types", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Collection of useful helper functions when trying to determine module type (CommonJS or AMD) properties of an AST node.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -113,8 +113,13 @@ var types = require('../'); | ||
assert(check('export default 123;', types.isES6Export, true)); | ||
assert(check('export {foo, bar};', types.isES6Export, true)); | ||
assert(check('export { D as default };', types.isES6Export, true)); | ||
assert(check('export {foo, bar}; function foo() {} function bar() {}', types.isES6Export, true)); | ||
assert(check('export { D as default }; class D {}', types.isES6Export, true)); | ||
assert(check('export function inc() { counter++; }', types.isES6Export, true)); | ||
assert(check('export * from "mod";', types.isES6Export, true)); | ||
}); | ||
it('detects dynamic imports', function() { | ||
assert(check('import("./bar");', types.isDynamicImport, true)); | ||
assert(check('function foo() { import("./bar"); }', types.isDynamicImport, true)); | ||
}); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13449
266