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 4.2.1 to 4.2.2

4

index.d.ts

@@ -94,3 +94,5 @@ // Original from DefinitelyTyped. Thanks a million

source: TSource,
keys?: readonly (keyof TSource)[]
// Although it actually accepts more key types and filters then`,
// we set the type of `keys` stricter
keys?: readonly (number | string)[]
): TTarget
{
"name": "comment-json",
"version": "4.2.1",
"version": "4.2.2",
"description": "Parse and stringify JSON with comments. It will retain comments even after saved!",

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

@@ -131,3 +131,3 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-comment-json.svg?branch=master)](https://travis-ci.org/kaelzhang/node-comment-json)

Returns `object | string | number | boolean | null` corresponding to the given JSON text.
Returns `CommentJSONValue` (`object | string | number | boolean | null`) corresponding to the given JSON text.

@@ -134,0 +134,0 @@ If the `content` is:

const hasOwnProperty = require('has-own-prop')
const {isObject, isArray} = require('core-util-is')
const {
isObject,
isArray,
isString,
isNumber
} = require('core-util-is')

@@ -108,2 +113,6 @@ const PREFIX_BEFORE = 'before'

keys.forEach(key => {
if (!isString(key) && !isNumber(key)) {
return
}
if (!hasOwnProperty(source, key)) {

@@ -110,0 +119,0 @@ return

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