mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Ensure fp.isEqualWith rearg is (c,a,b). [closes #2131]
This commit is contained in:
@@ -143,6 +143,7 @@ exports.methodRearg = {
|
|||||||
'assignInWith': [1, 2, 0],
|
'assignInWith': [1, 2, 0],
|
||||||
'assignWith': [1, 2, 0],
|
'assignWith': [1, 2, 0],
|
||||||
'getOr': [2, 1, 0],
|
'getOr': [2, 1, 0],
|
||||||
|
'isEqualWith': [1, 2, 0],
|
||||||
'isMatchWith': [2, 1, 0],
|
'isMatchWith': [2, 1, 0],
|
||||||
'mergeWith': [1, 2, 0],
|
'mergeWith': [1, 2, 0],
|
||||||
'padChars': [2, 1, 0],
|
'padChars': [2, 1, 0],
|
||||||
|
|||||||
@@ -868,7 +868,7 @@
|
|||||||
object = { 'a': 1 };
|
object = { 'a': 1 };
|
||||||
|
|
||||||
QUnit.test('should provide the correct `customizer` arguments', function(assert) {
|
QUnit.test('should provide the correct `customizer` arguments', function(assert) {
|
||||||
assert.expect(5);
|
assert.expect(6);
|
||||||
|
|
||||||
var args,
|
var args,
|
||||||
value = _.clone(object);
|
value = _.clone(object);
|
||||||
@@ -888,11 +888,26 @@
|
|||||||
|
|
||||||
assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith');
|
assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith');
|
||||||
|
|
||||||
var stack = { '__data__': { 'array': [], 'map': null } },
|
var iteration = 0,
|
||||||
expected = [[1], [2, 3], 'a', { 'a': [1] }, { 'a': [2, 3] }, stack];
|
objects = [{ 'a': 1 }, { 'a': 2 }],
|
||||||
|
stack = { '__data__': { 'array': [[objects[0], objects[1]]], 'map': null } },
|
||||||
|
expected = [1, 2, 'a', objects[0], objects[1], stack];
|
||||||
|
|
||||||
|
args = undefined;
|
||||||
|
|
||||||
|
fp.isEqualWith(function() {
|
||||||
|
if (++iteration == 2) {
|
||||||
|
args = _.map(arguments, _.cloneDeep);
|
||||||
|
}
|
||||||
|
})(objects[0])(objects[1]);
|
||||||
|
|
||||||
|
args[5] = _.omitBy(args[5], _.isFunction);
|
||||||
|
assert.deepEqual(args, expected, 'fp.isEqualWith');
|
||||||
|
|
||||||
args = undefined;
|
args = undefined;
|
||||||
value = { 'a': [1] };
|
value = { 'a': [1] };
|
||||||
|
stack = { '__data__': { 'array': [], 'map': null } };
|
||||||
|
expected = [[1], [2, 3], 'a', { 'a': [1] }, { 'a': [2, 3] }, stack];
|
||||||
|
|
||||||
fp.mergeWith(function() {
|
fp.mergeWith(function() {
|
||||||
args || (args = _.map(arguments, _.cloneDeep));
|
args || (args = _.map(arguments, _.cloneDeep));
|
||||||
|
|||||||
Reference in New Issue
Block a user