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

object-assign-deep

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-assign-deep - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

2

.eslintrc.js
module.exports = {
"extends": "eslint-config-recombix",
"rules": {
"quotes": [2, "single"]
},
};

@@ -14,11 +14,11 @@ 'use strict';

if (input === null) {
return `null`;
return 'null';
}
else if (typeof input === `undefined`) {
return `undefined`;
else if (typeof input === 'undefined') {
return 'undefined';
}
else if (typeof input === `object`) {
return (Array.isArray(input) ? `array` : `object`);
else if (typeof input === 'object') {
return (Array.isArray(input) ? 'array' : 'object');
}

@@ -36,3 +36,3 @@

// The value is an object so lets clone it.
if (getTypeOf(value) === `object`) {
if (getTypeOf(value) === 'object') {
return quickCloneObject(value);

@@ -42,3 +42,3 @@ }

// The value is an array so lets clone it.
else if (getTypeOf(value) === `array`) {
else if (getTypeOf(value) === 'array') {
return quickCloneArray(value);

@@ -83,3 +83,3 @@ }

const options = {
arrayBehaviour: _options.arrayBehaviour || `replace`, // Can be "merge" or "replace".
arrayBehaviour: _options.arrayBehaviour || 'replace', // Can be "merge" or "replace".
};

@@ -89,3 +89,2 @@

const objects = _objects.map(object => object || {});
const output = target || {};

@@ -104,5 +103,5 @@

if (type === `object`) {
if (existingValueType !== `undefined`) {
const existingValue = (existingValueType === `object` ? output[key] : {});
if (type === 'object') {
if (existingValueType !== 'undefined') {
const existingValue = (existingValueType === 'object' ? output[key] : {});
output[key] = executeDeepMerge({}, [existingValue, quickCloneObject(value)], options);

@@ -115,6 +114,6 @@ }

else if (type === `array`) {
if (existingValueType === `array`) {
else if (type === 'array') {
if (existingValueType === 'array') {
const newValue = quickCloneArray(value);
output[key] = (options.arrayBehaviour === `merge` ? output[key].concat(newValue) : newValue);
output[key] = (options.arrayBehaviour === 'merge' ? output[key].concat(newValue) : newValue);
}

@@ -130,3 +129,2 @@ else {

}

@@ -133,0 +131,0 @@ }

@@ -10,3 +10,3 @@ {

"name": "object-assign-deep",
"version": "0.3.1",
"version": "0.4.0",
"description": "Allows deep cloning of plain objects that contain primitives, nested plain objects, or nested plain arrays.",

@@ -36,6 +36,10 @@ "keywords": [

"eslint-config-recombix": "latest",
"eslint-config-vue": "latest",
"eslint-plugin-disable": "latest",
"eslint-plugin-filenames": "latest",
"eslint-plugin-html": "latest",
"eslint-plugin-json": "latest",
"eslint-plugin-node": "^4.2.1",
"eslint-plugin-promise": "latest"
"eslint-plugin-node": "latest",
"eslint-plugin-promise": "latest",
"eslint-plugin-vue": "latest"
},

@@ -42,0 +46,0 @@ "license": "MIT",

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