You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

safe-stringify

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-stringify - npm Package Compare versions

Comparing version

to
1.2.0

6

index.js
function safeStringifyReplacer(seen) {
return function (key, value) {
const replacer = function (key, value) {
// Handle objects with a custom `.toJSON()` method.

@@ -21,3 +21,3 @@ if (typeof value?.toJSON === 'function') {

for (const [key2, value2] of Object.entries(value)) {
newValue[key2] = safeStringifyReplacer(seen)(key2, value2);
newValue[key2] = replacer(key2, value2);
}

@@ -29,2 +29,4 @@

};
return replacer;
}

@@ -31,0 +33,0 @@

{
"name": "safe-stringify",
"version": "1.1.1",
"version": "1.2.0",
"description": "Serialize objects to JSON with handling for circular references",

@@ -5,0 +5,0 @@ "license": "MIT",