Socket
Socket
Sign inDemoInstall

deepmerge

Package Overview
Dependencies
0
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.2.1 to 4.2.2

4

changelog.md

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

# [4.2.2](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.2)
- `isMergeableObject` is now only called if there are two values that could be merged. [a34dd4d2](https://github.com/TehShrike/deepmerge/commit/a34dd4d25bf5e250653540a2022bc832c7b00a19)
# [4.2.1](https://github.com/TehShrike/deepmerge/releases/tag/v4.2.1)

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

6

dist/cjs.js

@@ -91,6 +91,6 @@ 'use strict';

if (!options.isMergeableObject(source[key]) || !propertyIsOnObject(target, key)) {
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
} else {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
}

@@ -97,0 +97,0 @@ });

@@ -95,6 +95,6 @@ (function (global, factory) {

if (!options.isMergeableObject(source[key]) || !propertyIsOnObject(target, key)) {
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
} else {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
}

@@ -101,0 +101,0 @@ });

@@ -66,6 +66,6 @@ var defaultIsMergeableObject = require('is-mergeable-object')

if (!options.isMergeableObject(source[key]) || !propertyIsOnObject(target, key)) {
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options)
} else {
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options)
} else {
destination[key] = getMergeFunction(key, options)(target[key], source[key], options)
}

@@ -72,0 +72,0 @@ })

@@ -12,3 +12,3 @@ {

],
"version": "4.2.1",
"version": "4.2.2",
"homepage": "https://github.com/TehShrike/deepmerge",

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

@@ -212,15 +212,15 @@ # deepmerge

const alex = {
name: {
first: 'Alex',
last: 'Alexson'
},
pets: ['Cat', 'Parrot']
name: {
first: 'Alex',
last: 'Alexson'
},
pets: ['Cat', 'Parrot']
}
const tony = {
name: {
first: 'Tony',
last: 'Tonison'
},
pets: ['Dog']
name: {
first: 'Tony',
last: 'Tonison'
},
pets: ['Dog']
}

@@ -231,7 +231,7 @@

const options = {
customMerge: (key) => {
if (key === 'name') {
return mergeNames
}
}
customMerge: (key) => {
if (key === 'name') {
return mergeNames
}
}
}

@@ -238,0 +238,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