commonjs-walker
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -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) { |
{ | ||
"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 @@ ]; |
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
28588
47
811