Socket
Socket
Sign inDemoInstall

detective-es6

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

detective-es6 - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

3

index.js

@@ -40,2 +40,5 @@ 'use strict';

case 'CallExpression':
if (options && options.skipAsyncImports) {
break;
}
if (node.callee.type === 'Import' && node.arguments.length) {

@@ -42,0 +45,0 @@ dependencies.push(node.arguments[0].value);

2

package.json
{
"name": "detective-es6",
"version": "2.1.0",
"version": "2.2.0",
"description": "Get the dependencies of an es6 module",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -18,7 +18,12 @@ ### detective-es6 [![npm](http://img.shields.io/npm/v/detective-es6.svg)](https://npmjs.org/package/detective-es6) [![npm](http://img.shields.io/npm/dm/detective-es6.svg)](https://npmjs.org/package/detective-es6)

```
* Supports JSX, Flow, and any other features that [node-source-walk](https://github.com/mrjoelkemp/node-source-walk) supports.
You may also (optionally) configure the detective via a second object argument detective(src, options) that supports the following options:
- skipTypeImports: (Boolean) whether or not to omit type imports (`import type {foo} from "mylib";`) in the list of extracted dependencies.
- skipAsyncImports: (Boolean) whether or not to omit async imports (`import('foo')`) in the list of extracted dependencies.
#### License
MIT

@@ -107,2 +107,16 @@ 'use strict';

});
it('respects settings for async imports', function() {
const source = 'import("myLib")';
const depsWithAsync = detective(source);
const depsWithoutAsync = detective(source, {skipAsyncImports: true});
assert.deepEqual(depsWithAsync, ['myLib']);
assert.deepEqual(depsWithoutAsync, []);
});
it('respects settings for async imports with multiple imports', function() {
const source = 'import("myLib");\nimport foo from \'foo\'';
const depsWithoutAsync = detective(source, {skipAsyncImports: true});
assert.deepEqual(depsWithoutAsync, ['foo']);
});
});
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