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

superjson

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superjson - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

test.js

5

History.md
0.0.4 / 2016-01-22
==================
* improve for undefined values and literals
0.0.3 / 2014-12-30

@@ -3,0 +8,0 @@ ==================

8

index.js

@@ -31,5 +31,9 @@ /**

var stringify = exports.stringify = function (obj, replacer, space) {
return json.stringify(obj, function(k, v) {
var str = json.stringify(obj, function(k, v) {
return replacer ? replacer(k, coerce(k, v)) : coerce(k, v);
}, space);
return str[0] === '"' && str[str.length - 1] === '"'
? str.slice(1, -1)
: str
}

@@ -67,2 +71,3 @@

case 'function': return v.toString();
case 'undefined': return 'undefined';
default: return v;

@@ -83,2 +88,3 @@ }

if (rdate.test(v)) return stod(v);
if ('undefined' === v) return undefined;
if ('/' == v[0] && rregexp.test(v)) return stor(v);

@@ -85,0 +91,0 @@ if ('function' == v.slice(0, 8) && '}' == v[v.length - 1] && isfn(v)) return stof(v);

2

package.json
{
"name": "superjson",
"version": "0.0.3",
"version": "0.0.4",
"description": "extends JSON.stringify and JSON.parse to support additional JS types (Dates, RegExps, Functions, etc.)",

@@ -5,0 +5,0 @@ "keywords": [],

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