json-parser
Advanced tools
Comparing version 0.2.4 to 1.0.0
{ | ||
"name": "json-parser", | ||
"version": "0.2.4", | ||
"version": "1.0.0", | ||
"description": "JSON parser to parse JSON object and MAINTAIN comments.", | ||
@@ -36,4 +36,4 @@ "main": "index.js", | ||
"dependencies": { | ||
"esprima": "^1.2.2" | ||
"esprima": "^2.4.1" | ||
} | ||
} |
@@ -1,3 +0,7 @@ | ||
# json-parser [![NPM version](https://badge.fury.io/js/json-parser.svg)](http://badge.fury.io/js/json-parser) [![Build Status](https://travis-ci.org/kaelzhang/node-json-parser.svg?branch=master)](https://travis-ci.org/kaelzhang/node-json-parser) [![Dependency Status](https://gemnasium.com/kaelzhang/node-json-parser.svg)](https://gemnasium.com/kaelzhang/node-json-parser) | ||
[![NPM version](https://badge.fury.io/js/json-parser.svg)](http://badge.fury.io/js/json-parser) | ||
[![Build Status](https://travis-ci.org/kaelzhang/node-json-parser.svg?branch=master)](https://travis-ci.org/kaelzhang/node-json-parser) | ||
[![Dependency Status](https://gemnasium.com/kaelzhang/node-json-parser.svg)](https://gemnasium.com/kaelzhang/node-json-parser) | ||
# json-parser | ||
JSON parser to parse JSON object and MAINTAIN comments. | ||
@@ -16,3 +20,4 @@ | ||
content | ||
``` | ||
```js | ||
/** | ||
@@ -19,0 +24,0 @@ blah |
@@ -78,2 +78,38 @@ 'use strict'; | ||
}); | ||
}); | ||
}); | ||
var invalid = [ | ||
'{', | ||
'}', | ||
'[', | ||
'', | ||
'{a:1}', | ||
'{"a":a}', | ||
'{"a":undefined}' | ||
]; | ||
// ECMA262 does not define the standard of error messages. | ||
// However, we throw error messages the same as JSON.parse() | ||
describe("error messages", function(){ | ||
invalid.forEach(function (i) { | ||
it('error message:' + i, function(){ | ||
var error; | ||
var err; | ||
try { | ||
parser.parse(i); | ||
} catch(e) { | ||
error = e; | ||
} | ||
try { | ||
JSON.parse(i); | ||
} catch(e) { | ||
err = e; | ||
} | ||
expect(!!(err && error)).to.equal(true); | ||
expect(error.message).to.equal(err.message); | ||
}); | ||
}); | ||
}); |
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
Possible typosquat attack
Supply chain riskThere is a package with a similar name that is downloaded much more often.
Did you mean |
---|
jsonc-parser |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10586
309
1
64
0
+ Addedesprima@2.7.3(transitive)
- Removedesprima@1.2.5(transitive)
Updatedesprima@^2.4.1