Socket
Socket
Sign inDemoInstall

letsfreezethat

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

letsfreezethat - npm Package Compare versions

Comparing version 3.0.2 to 3.0.3

23

lib/main.js

@@ -56,4 +56,5 @@ (function() {

deep_freeze = function(d) {
var k, v;
if ((!d) || d === true) {
/* thx to https://github.com/lukeed/klona/blob/master/src/json.js */
var is_first, k, v;
if ((!d) || (d === true)) {
/* TAINT code duplication */

@@ -63,3 +64,3 @@ /* immediately return for zero, empty string, null, undefined, NaN, false, true: */

}
/* thx to https://github.com/lukeed/klona/blob/master/src/json.js */
is_first = true;
switch (Object.prototype.toString.call(d)) {

@@ -69,6 +70,8 @@ case '[object Array]':

while (k--) {
if (((v = d[k]) != null) && ((typeof v) === 'object')) {
if (((v = d[k]) != null) && ((typeof v) === 'object') && (!frozen(v))) {
if (is_first && (frozen(d))) {
is_first = false;
d = deep_copy(d);
}
d[k] = deep_freeze(v);
} else {
d[k] = v;
}

@@ -80,6 +83,8 @@ }

v = d[k];
if ((v != null) && ((typeof v) === 'object')) {
if ((v != null) && ((typeof v) === 'object') && (!frozen(v))) {
if (is_first && (frozen(d))) {
is_first = false;
d = deep_copy(d);
}
d[k] = deep_freeze(v);
} else {
d[k] = v;
}

@@ -86,0 +91,0 @@ }

{
"name": "letsfreezethat",
"version": "3.0.2",
"version": "3.0.3",
"description": "An utterly minimal immutability library in the spirit of immer",

@@ -5,0 +5,0 @@ "main": "./freeze.js",

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