Socket
Socket
Sign inDemoInstall

detective

Package Overview
Dependencies
Maintainers
38
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

detective - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

test/es2019.js

3

CHANGELOG.md

@@ -5,2 +5,5 @@ # detective Change Log

## 5.2.0 - 2019-01-28
* Use acorn-node's option defaults, adds support for new ES features (https://github.com/browserify/detective/pull/81)
## 5.1.0 - 2018-02-28

@@ -7,0 +10,0 @@ * Use acorn-node parser, which matches latest Node syntax support (https://github.com/browserify/detective/pull/78)

22

index.js

@@ -9,16 +9,16 @@ var acorn = require('acorn-node');

if (!opts) opts = {};
return acorn.parse(src, {
ecmaVersion: defined(opts.ecmaVersion, 9),
sourceType: defined(opts.sourceType, 'script'),
var acornOpts = {
ranges: defined(opts.ranges, opts.range),
locations: defined(opts.locations, opts.loc),
allowReserved: defined(opts.allowReserved, true),
allowReturnOutsideFunction: defined(
opts.allowReturnOutsideFunction, true
),
allowImportExportEverywhere: defined(
opts.allowImportExportEverywhere, true
),
allowHashBang: defined(opts.allowHashBang, true)
});
allowImportExportEverywhere: defined(opts.allowImportExportEverywhere, false)
};
// Use acorn-node's defaults for the rest.
if (opts.ecmaVersion != null) acornOpts.ecmaVersion = opts.ecmaVersion;
if (opts.sourceType != null) acornOpts.sourceType = opts.sourceType;
if (opts.allowHashBang != null) acornOpts.allowHashBang = opts.allowHashBang;
if (opts.allowReturnOutsideFunction != null) acornOpts.allowReturnOutsideFunction = opts.allowReturnOutsideFunction;
return acorn.parse(src, acornOpts);
}

@@ -25,0 +25,0 @@

{
"name": "detective",
"description": "find all require() calls by walking the AST",
"version": "5.1.0",
"version": "5.2.0",
"author": {

@@ -12,3 +12,3 @@ "name": "James Halliday",

"dependencies": {
"acorn-node": "^1.3.0",
"acorn-node": "^1.6.1",
"defined": "^1.0.0",

@@ -15,0 +15,0 @@ "minimist": "^1.1.1"

Sorry, the diff of this file is not supported yet

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