comment-json
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -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); |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
16703
29
459
0