Socket
Socket
Sign inDemoInstall

serialize-javascript

Package Overview
Dependencies
2
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 5.0.0

.github/dependabot.yml

16

index.js

@@ -14,3 +14,3 @@ /*

var UID = generateUID();
var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|U|I|B)-' + UID + '-(\\d+)__@"', 'g');
var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|A|U|I|B)-' + UID + '-(\\d+)__@"', 'g');

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

var sets = [];
var arrays = [];
var undefs = [];

@@ -111,2 +112,9 @@ var infinities= [];

}
if(origValue instanceof Array) {
var isSparse = origValue.filter(function(){return true}).length !== origValue.length;
if (isSparse) {
return '@__A-' + UID + '-' + (arrays.push(origValue) - 1) + '__@';
}
}
}

@@ -203,3 +211,3 @@

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

@@ -235,2 +243,6 @@ }

if (type === 'A') {
return "Array.prototype.slice.call(" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + ")";
}
if (type === 'U') {

@@ -237,0 +249,0 @@ return 'undefined'

4

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

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

"chai": "^4.1.0",
"mocha": "^7.0.0",
"mocha": "^8.0.1",
"nyc": "^15.0.0"

@@ -33,0 +33,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc