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

deepmerge

Package Overview
Dependencies
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deepmerge - npm Package Compare versions

Comparing version 1.4.4 to 1.5.0

4

changelog.md

@@ -0,1 +1,5 @@

# [1.5.0](https://github.com/KyleAMathews/deepmerge/releases/tag/v1.5.0)
- bug fix: merging objects into arrays was allowed, and doesn't make any sense. [#65](https://github.com/KyleAMathews/deepmerge/issues/65) published as a feature release instead of a patch because it is a decent behavior change.
# [1.4.4](https://github.com/KyleAMathews/deepmerge/releases/tag/v1.4.4)

@@ -2,0 +6,0 @@

12

dist/cjs.js

@@ -59,8 +59,12 @@ 'use strict';

function deepmerge(target, source, optionsArgument) {
var array = Array.isArray(source);
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var options = optionsArgument || { arrayMerge: defaultArrayMerge };
var arrayMerge = options.arrayMerge || defaultArrayMerge;
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (array) {
return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument)
if (!sourceAndTargetTypesMatch) {
return cloneIfNecessary(source, optionsArgument)
} else if (sourceIsArray) {
var arrayMerge = options.arrayMerge || defaultArrayMerge;
return arrayMerge(target, source, optionsArgument)
} else {

@@ -67,0 +71,0 @@ return mergeObject(target, source, optionsArgument)

@@ -57,8 +57,12 @@ var index$2 = function isMergeableObject(value) {

function deepmerge(target, source, optionsArgument) {
var array = Array.isArray(source);
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var options = optionsArgument || { arrayMerge: defaultArrayMerge };
var arrayMerge = options.arrayMerge || defaultArrayMerge;
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (array) {
return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument)
if (!sourceAndTargetTypesMatch) {
return cloneIfNecessary(source, optionsArgument)
} else if (sourceIsArray) {
var arrayMerge = options.arrayMerge || defaultArrayMerge;
return arrayMerge(target, source, optionsArgument)
} else {

@@ -65,0 +69,0 @@ return mergeObject(target, source, optionsArgument)

@@ -63,8 +63,12 @@ (function (global, factory) {

function deepmerge(target, source, optionsArgument) {
var array = Array.isArray(source);
var sourceIsArray = Array.isArray(source);
var targetIsArray = Array.isArray(target);
var options = optionsArgument || { arrayMerge: defaultArrayMerge };
var arrayMerge = options.arrayMerge || defaultArrayMerge;
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
if (array) {
return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument)
if (!sourceAndTargetTypesMatch) {
return cloneIfNecessary(source, optionsArgument)
} else if (sourceIsArray) {
var arrayMerge = options.arrayMerge || defaultArrayMerge;
return arrayMerge(target, source, optionsArgument)
} else {

@@ -71,0 +75,0 @@ return mergeObject(target, source, optionsArgument)

@@ -44,8 +44,12 @@ var isMergeableObject = require('is-mergeable-object')

function deepmerge(target, source, optionsArgument) {
var array = Array.isArray(source)
var sourceIsArray = Array.isArray(source)
var targetIsArray = Array.isArray(target)
var options = optionsArgument || { arrayMerge: defaultArrayMerge }
var arrayMerge = options.arrayMerge || defaultArrayMerge
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray
if (array) {
return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument)
if (!sourceAndTargetTypesMatch) {
return cloneIfNecessary(source, optionsArgument)
} else if (sourceIsArray) {
var arrayMerge = options.arrayMerge || defaultArrayMerge
return arrayMerge(target, source, optionsArgument)
} else {

@@ -52,0 +56,0 @@ return mergeObject(target, source, optionsArgument)

@@ -13,3 +13,3 @@ {

],
"version": "1.4.4",
"version": "1.5.0",
"homepage": "https://github.com/KyleAMathews/deepmerge",

@@ -16,0 +16,0 @@ "repository": {

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