Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsan

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsan - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

built.js

0

index.js
module.exports = require('./lib');

@@ -0,0 +0,0 @@ var pathGetter = require('./path-getter');

25

lib/index.js
var cycle = require('./cycle');
exports.stringify = function stringify(value, replacer, space) {
exports.stringify = function stringify(value, replacer, space, forceDecycle) {
try {
return JSON.stringify(value, replacer, space);
} catch (e) {
var decycled = cycle.decycle(value);
if (!forceDecycle) {
if (arguments.length === 1) {
return JSON.stringify(value);
} else {
return JSON.stringify.apply(JSON, arguments);
}
}
} catch (e) {}
var decycled = cycle.decycle(value);
if (arguments.length === 1) {
return JSON.stringify(decycled);
} else {
return JSON.stringify(decycled, replacer, space);
}
}

@@ -14,3 +24,8 @@

var needsRetrocycle = text.indexOf('"$ref"') > -1;
var parsed = JSON.parse(text, reviver)
var parsed;
if (arguments.length === 1) {
parsed = JSON.parse(text);
} else {
parsed = JSON.parse(text, reviver);
}
if (needsRetrocycle) {

@@ -17,0 +32,0 @@ parsed = cycle.retrocycle(parsed);

@@ -0,0 +0,0 @@ module.exports = pathGetter;

{
"name": "jsan",
"version": "2.0.0",
"version": "2.0.1",
"description": "handle circular references when stringifying and parsing",

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

@@ -0,0 +0,0 @@ jsan

@@ -0,0 +0,0 @@ var assert = require('assert');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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