Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.2 to 0.1.3

test/fixtures/simple-null-2.json

19

lib/stringify.js

@@ -164,3 +164,3 @@ 'use strict';

var top = join_comments(prev, 1);
var top = join(prev, 1);
var right = prev[2];

@@ -207,3 +207,3 @@ if (top) {

// ```
v += ' ' + right.join('\n');
v += ' ' + join_comments(right);
}

@@ -288,4 +288,4 @@ partial.push(v + (last ? '' : '\n'));

var head_comments = join_comments(value, '//^', true);
var foot_comments = join_comments(value, '//$', true);
var head_comments = join(value, '//^', true);
var foot_comments = join(value, '//$', true);

@@ -300,5 +300,5 @@ // Make a fake root object containing our value under the key of ''.

function join_comments (host, key, extra, remove) {
function join (host, key, extra, remove) {
var str = host[key]
? host[key].join('\n') + '\n'
? join_comments(host[key]) + '\n'
: '';

@@ -312,1 +312,8 @@

}
function join_comments (value) {
return is_array(value)
? value.join('\n')
: value;
}
{
"name": "comment-json",
"version": "0.1.2",
"version": "0.1.3",
"description": "Parse and stringify JSON file with domments",

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

@@ -91,4 +91,6 @@ 'use strict';

'duplex',
'deep'
],
'deep',
// simple case, of which the comment is not an array.
'simple'
],
[null],

@@ -95,0 +97,0 @@ [2, 3, null], run);

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