Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ast-module-types

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ast-module-types - npm Package Compare versions

Comparing version 2.5.0 to 2.6.0

4

index.js

@@ -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;
};

2

package.json
{
"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));
});
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc