Socket
Socket
Sign inDemoInstall

serialize-javascript

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serialize-javascript - npm Package Compare versions

Comparing version 2.1.2 to 3.0.0

.vscode/settings.json

13

index.js

@@ -11,3 +11,3 @@ /*

var UID = Math.floor(Math.random() * 0x10000000000).toString(16);
var PLACE_HOLDER_REGEXP = new RegExp('"@__(F|R|D|M|S|U)-' + UID + '-(\\d+)__@"', 'g');
var PLACE_HOLDER_REGEXP = new RegExp('"@__(F|R|D|M|S|U|I)-' + UID + '-(\\d+)__@"', 'g');

@@ -61,2 +61,3 @@ var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g;

var undefs = [];
var infinities= [];

@@ -107,2 +108,6 @@ // Returns placeholders for functions and regexps (identified by index)

if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) {
return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@';
}
return value;

@@ -181,3 +186,3 @@ }

if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && undefs.length === 0) {
if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && undefs.length === 0 && infinities.length === 0) {
return str;

@@ -210,2 +215,6 @@ }

if (type === 'I') {
return infinities[valueIndex];
}
var fn = functions[valueIndex];

@@ -212,0 +221,0 @@

6

package.json
{
"name": "serialize-javascript",
"version": "2.1.2",
"version": "3.0.0",
"description": "Serialize JavaScript to a superset of JSON that includes regular expressions and functions.",

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

"chai": "^4.1.0",
"mocha": "^6.2.0",
"nyc": "^14.1.1"
"mocha": "^7.0.0",
"nyc": "^15.0.0"
}
}
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