New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

copykitten

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

copykitten - npm Package Compare versions

Comparing version

to
0.0.6

25

copykitten.js

@@ -44,13 +44,2 @@ (function (global, factory) {

function deepMerge(a, b) {
props(b).forEach(function (k) {
if (typeof a[k] === 'object' && typeof b[k] === 'object') {
a[k] = a[k].deepMerge(b[k]);
}
else {
a[k] = b[k];
}
});
}
function thaw(source, constructor) {

@@ -85,3 +74,15 @@ return merge(new (constructor || source.constructor), source);

FrozenObject.prototype.deepMerge = updater(function (obj) {
deepMerge(this, obj);
var a = this;
var b = obj;
props(b).forEach(function (k) {
if (typeof a[k] === 'object' &&
typeof b[k] === 'object' &&
!Array.isArray(b[k]) &&
!(a[k] instanceof FrozenArray)) {
a[k] = a[k].deepMerge(b[k]);
}
else {
a[k] = b[k];
}
});
});

@@ -88,0 +89,0 @@

{
"name": "copykitten",
"version": "0.0.5",
"version": "0.0.6",
"description": "Tiny immutable JSON data structures",

@@ -5,0 +5,0 @@ "scripts": {

@@ -175,3 +175,6 @@ var assert = (typeof chai === 'undefined') ?

}
}
},
tags: [{id: 1, name: 'one'}, 2, 3, 4],
foo: {a: 1},
bar: ['bar']
});

@@ -188,3 +191,6 @@ var obj2 = obj.deepMerge({

something: 'else'
}
},
tags: [{id: 1}],
foo: ['foo'],
bar: {b: 2}
});

@@ -203,3 +209,6 @@ assert.deepEqual(JSON.parse(JSON.stringify(obj2)), {

something: 'else'
}
},
tags: [{id: 1}],
foo: ['foo'],
bar: {b: 2}
});

@@ -206,0 +215,0 @@ });