mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 00:57:48 +00:00
Loosen restrictions of _.intersection and others to accept array-like objects and add isArrayLike helper. [closes #1163]
This commit is contained in:
@@ -3855,12 +3855,11 @@
|
||||
deepEqual(_.difference([1, NaN, 3], largeArray), [1, 3]);
|
||||
});
|
||||
|
||||
test('should ignore values that are not arrays or `arguments` objects', 4, function() {
|
||||
test('should ignore values that are not array-like', 3, function() {
|
||||
var array = [1, null, 3];
|
||||
deepEqual(_.difference(args, 3, { '0': 1 }), [1, 2, 3]);
|
||||
deepEqual(_.difference(null, array, 1), []);
|
||||
deepEqual(_.difference(array, args, null), [null]);
|
||||
deepEqual(_.difference('abc', array, 'b'), []);
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
@@ -16532,10 +16531,6 @@
|
||||
var array = [1, 2, 3, 1, 2, 3];
|
||||
deepEqual(_.without(array, 1, 2), [3, 3]);
|
||||
});
|
||||
|
||||
test('should treat string values for `array` as empty', 1, function() {
|
||||
deepEqual(_.without('abc', 'b'), []);
|
||||
});
|
||||
}(1, 2, 3));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user