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

webpack-merge

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-merge - npm Package Compare versions

Comparing version 0.8.4 to 0.9.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

0.9.0 / 2016-04-08
==================
* Feature: Allow existing objects/arrays to be emptied with an empty object/array later in merge. This overriding behavior is useful for example emptying your `entry` configuration.
0.8.4 / 2016-03-17

@@ -2,0 +7,0 @@ ==================

@@ -46,2 +46,6 @@ 'use strict';

if (!b.length) {
return [];
}
if (customResult) {

@@ -59,2 +63,6 @@ return customResult;

if (isPlainObject(a) && isPlainObject(b)) {
if (!Object.keys(b).length) {
return {};
}
return merge({}, a, b, joinArrays.bind(null, customizer));

@@ -61,0 +69,0 @@ }

2

package.json

@@ -5,3 +5,3 @@ {

"author": "Juho Vepsalainen <bebraw@gmail.com>",
"version": "0.8.4",
"version": "0.9.0",
"scripts": {

@@ -8,0 +8,0 @@ "build": "babel src -d lib",

@@ -40,2 +40,6 @@ const isArray = Array.isArray;

if (!b.length) {
return [];
}
if (customResult) {

@@ -53,2 +57,6 @@ return customResult;

if (isPlainObject(a) && isPlainObject(b)) {
if (!Object.keys(b).length) {
return {};
}
return merge({}, a, b, joinArrays.bind(null, customizer));

@@ -55,0 +63,0 @@ }

@@ -176,2 +176,16 @@ /* eslint-env mocha */

});
it('should allow overriding with an empty array in ' + loadersKey, function () {
const a = {};
a[loadersKey] = [{
test: /\.js$/,
loaders: ['a?1']
}];
const b = {};
b[loadersKey] = [];
const result = {};
result[loadersKey] = [];
assert.deepEqual(merge(a, b), result);
});
}

@@ -549,2 +563,26 @@

});
it('should allow overriding with an empty array', function () {
const a = {
entry: ['foo']
};
const b = {
entry: []
};
assert.deepEqual(merge(a, b), b);
});
it('should allow overriding with an empty object', function () {
const a = {
entry: {
a: 'foo'
}
};
const b = {
entry: {}
};
assert.deepEqual(merge(a, b), b);
});
}
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