comment-json
Advanced tools
Comparing version 0.1.11 to 1.0.0
{ | ||
"name": "comment-json", | ||
"version": "0.1.11", | ||
"version": "1.0.0", | ||
"description": "Parse and stringify JSON file with comments", | ||
@@ -16,2 +16,3 @@ "main": "index.js", | ||
"comments", | ||
"annotations", | ||
"json", | ||
@@ -36,4 +37,4 @@ "json-stringify", | ||
"dependencies": { | ||
"json-parser": "^0.2.0" | ||
"json-parser": "^1.0.0" | ||
} | ||
} |
@@ -1,3 +0,7 @@ | ||
# comment-json [![NPM version](https://badge.fury.io/js/comment-json.svg)](http://badge.fury.io/js/comment-json) [![Build Status](https://travis-ci.org/kaelzhang/node-comment-json.svg?branch=master)](https://travis-ci.org/kaelzhang/node-comment-json) [![Dependency Status](https://gemnasium.com/kaelzhang/node-comment-json.svg)](https://gemnasium.com/kaelzhang/node-comment-json) | ||
[![NPM version](https://badge.fury.io/js/comment-json.svg)](http://badge.fury.io/js/comment-json) | ||
[![Build Status](https://travis-ci.org/kaelzhang/node-comment-json.svg?branch=master)](https://travis-ci.org/kaelzhang/node-comment-json) | ||
[![Dependency Status](https://gemnasium.com/kaelzhang/node-comment-json.svg)](https://gemnasium.com/kaelzhang/node-comment-json) | ||
# comment-json | ||
- Parse JSON strings with comments into JavaScript objects. | ||
@@ -4,0 +8,0 @@ - stringify the objects into JSON strings with comments if there are. |
@@ -175,1 +175,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 { | ||
json.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
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
21193
556
1
153
+ Addedesprima@2.7.3(transitive)
+ Addedjson-parser@1.1.5(transitive)
- Removedesprima@1.2.5(transitive)
- Removedjson-parser@0.2.4(transitive)
Updatedjson-parser@^1.0.0