Socket
Socket
Sign inDemoInstall

commonjs-walker

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

commonjs-walker - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

test/fixtures/parser/json.json

14

lib/parser.js

@@ -17,2 +17,10 @@ 'use strict';

if (parser._isJson(path)) {
return callback(null, {
code: content,
path: path,
dependencies: []
});
}
parser._lexJs(content.toString(), function (err, ast) {

@@ -62,2 +70,8 @@ if (err) {

// @returns {Boolean}
parser._isJson = function (path) {
return /\.json$/i.test(path);
};
parser.read = function (path, callback) {

@@ -64,0 +78,0 @@ fs.readFile(path, function (err, content) {

2

package.json
{
"name": "commonjs-walker",
"version": "3.0.2",
"version": "3.0.3",
"description": "Analyzer and tree walker for commonjs.",

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

@@ -195,2 +195,9 @@ 'use strict';

},
{
desc: '#14: parsing a json file will not fail',
file: 'json/index.js',
expect: function (err, path, nodes, entry) {
expect(err).to.equal(null);
}
}
];

@@ -197,0 +204,0 @@

@@ -50,2 +50,7 @@ 'use strict';

deps: ['../abc', './abc']
},
{
desc: 'parsing a json file will not fail',
file: 'json.json',
deps: []
}

@@ -52,0 +57,0 @@ ];

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