🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

comment-json

Package Overview
Dependencies
Maintainers
1
Versions
64
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
4.4.0
to
4.4.1
+1
-1
package.json
{
"name": "comment-json",
"version": "4.4.0",
"version": "4.4.1",
"description": "Parse and stringify JSON with comments. It will retain comments even after saved!",

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

@@ -606,3 +606,3 @@ [![Build Status](https://github.com/kaelzhang/node-comment-json/actions/workflows/nodejs.yml/badge.svg)](https://github.com/kaelzhang/node-comment-json/actions/workflows/nodejs.yml)

`{"foo": 9007199254740993}`,
//
// The reviver function now has a 3rd param that contains the string source.
(key, value, {source}) =>

@@ -621,3 +621,3 @@ /^[0-9]+$/.test(source) ? BigInt(source) : value

// JSON.rawJSON is supported in node >= 21
? JSON.rawJSON(String(val)).rawJSON
? JSON.rawJSON(String(val))
: value

@@ -624,0 +624,0 @@ )

@@ -5,3 +5,4 @@ const {

isString,
isNumber
isNumber,
isFunction
} = require('core-util-is')

@@ -128,2 +129,9 @@

const is_raw_json = isFunction(JSON.isRawJSON)
// For backward compatibility,
// since JSON.isRawJSON is not supported in node < 21
? JSON.isRawJSON
// istanbul ignore next
: () => false
module.exports = {

@@ -159,2 +167,4 @@ SYMBOL_PREFIXES,

is_raw_json,
assign (target, source, keys) {

@@ -161,0 +171,0 @@ if (!isObject(target)) {

@@ -22,3 +22,5 @@ const {

UNDEFINED
UNDEFINED,
is_raw_json
} = require('./common')

@@ -296,2 +298,6 @@

case 'object':
if (is_raw_json(value)) {
return value.rawJSON
}
return isArray(value)

@@ -298,0 +304,0 @@ ? array_stringify(value, gap)