Socket
Socket
Sign inDemoInstall

comment-json

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

comment-json - npm Package Compare versions

Comparing version 0.1.11 to 1.0.0

5

package.json
{
"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"
}
}

6

README.md

@@ -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);
});
});
});
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