New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@apigames/json

Package Overview
Dependencies
Maintainers
1
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apigames/json - npm Package Compare versions

Comparing version 1.0.37 to 1.0.38

2

lib/utils.d.ts

@@ -17,3 +17,3 @@ export declare function isArray(value: any): boolean;

export declare function clone(value: any, shouldRedactUndefinedValues?: boolean): any;
export declare function stringify(obj: any, indent?: number, linePrefix?: string, quoteFieldNames?: boolean): string;
export declare function stringify(obj: any, indent?: number, linePrefix?: string, quoteFieldNames?: boolean, quoteChar?: string): string;
export declare function extractAndRedact(document: any, propertyName: string): any;

@@ -125,3 +125,3 @@ "use strict";

exports.clone = clone;
function stringify(obj, indent = 4, linePrefix = '', quoteFieldNames = true) {
function stringify(obj, indent = 4, linePrefix = '', quoteFieldNames = true, quoteChar = '"') {
const lines = JSON.stringify(obj, null, indent).split('\n');

@@ -142,2 +142,21 @@ if (linePrefix !== '') {

}
if (quoteChar !== '"') {
for (let i = 1; i < lines.length - 1; i++) {
if ((lines[i].match(/:/g) || []).length > 0) {
const [firstPart, ...subsequentParts] = lines[i].split(':');
let first = firstPart;
let second = subsequentParts.join(':');
const namePrefixLength = first.length - first.trimStart().length;
const namePrefix = Array(namePrefixLength).fill(' ').join('');
first = namePrefix + first.trim().replace(/(^")|(("$)|("(?=,$)))/g, quoteChar);
second = ` ${second.trim().replace(/(^")|(("$)|("(?=,$)))/g, quoteChar)}`;
lines[i] = `${first}:${second}`;
}
else {
const namePrefixLength = lines[i].length - lines[i].trimStart().length;
const namePrefix = Array(namePrefixLength).fill(' ').join('');
lines[i] = namePrefix + lines[i].trim().replace(/(^")|(("$)|("(?=,$)))/g, quoteChar);
}
}
}
return lines.join('\n');

@@ -144,0 +163,0 @@ }

@@ -6,3 +6,3 @@ {

"license": "MIT",
"version": "1.0.37",
"version": "1.0.38",
"main": "lib/index.js",

@@ -9,0 +9,0 @@ "types": "lib/index.d.ts",

Sorry, the diff of this file is not supported yet

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