Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "mrm-core", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Utilities to make tasks for mrm", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -10,2 +10,7 @@ 'use strict'; | ||
it('merge() should merge arrays of objects without duplicates', () => { | ||
const result = merge({ _: [{ a: 1 }, { b: 2 }] }, { _: [{ a: 1 }, { c: 3 }] }); | ||
expect(result).toEqual({ _: [{ a: 1 }, { b: 2 }, { c: 3 }] }); | ||
}); | ||
it('merge() should not remove existing array items', () => { | ||
@@ -12,0 +17,0 @@ const result = merge({ _: ['a', 'a', 'b'] }, { _: ['a'] }); |
'use strict'; | ||
const mergeBase = require('webpack-merge'); | ||
const difference = require('lodash/difference'); | ||
const differenceWith = require('lodash/differenceWith'); | ||
const isEqual = require('lodash/isEqual'); | ||
const merge = mergeBase({ | ||
customizeArray: (a, b) => a.concat(difference(b, a)), | ||
customizeArray: (a, b) => a.concat(differenceWith(b, a, isEqual)), | ||
}); | ||
module.exports = merge; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37936
980