mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Make fp.without an alias of fp.difference. [closes #2122]
This commit is contained in:
@@ -36,6 +36,7 @@ exports.aliasToReal = {
|
|||||||
'unnest': 'flatten',
|
'unnest': 'flatten',
|
||||||
'useWith': 'overArgs',
|
'useWith': 'overArgs',
|
||||||
'whereEq': 'filter',
|
'whereEq': 'filter',
|
||||||
|
'without': 'difference',
|
||||||
'zipObj': 'zipObject'
|
'zipObj': 'zipObject'
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -163,7 +164,8 @@ exports.methodSpread = {
|
|||||||
'invokeArgs': 2,
|
'invokeArgs': 2,
|
||||||
'invokeArgsMap': 2,
|
'invokeArgsMap': 2,
|
||||||
'partial': 1,
|
'partial': 1,
|
||||||
'partialRight': 1
|
'partialRight': 1,
|
||||||
|
'without': 1
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Used to identify methods which mutate arrays or objects. */
|
/** Used to identify methods which mutate arrays or objects. */
|
||||||
|
|||||||
@@ -471,7 +471,7 @@
|
|||||||
assert.expect(10);
|
assert.expect(10);
|
||||||
|
|
||||||
var array = ['a', 'b', 'c'],
|
var array = ['a', 'b', 'c'],
|
||||||
other = ['b', 'b', 'd'],
|
other = ['b', 'd', 'b'],
|
||||||
object = { 'a': 1, 'b': 2, 'c': 2 },
|
object = { 'a': 1, 'b': 2, 'c': 2 },
|
||||||
actual = fp.difference(array)(other);
|
actual = fp.difference(array)(other);
|
||||||
|
|
||||||
@@ -495,7 +495,7 @@
|
|||||||
actual = fp.uniqBy(_.identity, other);
|
actual = fp.uniqBy(_.identity, other);
|
||||||
assert.deepEqual(actual, ['b', 'd'], 'fp.uniqBy');
|
assert.deepEqual(actual, ['b', 'd'], 'fp.uniqBy');
|
||||||
|
|
||||||
actual = fp.without('b')(array);
|
actual = fp.without(array)(other);
|
||||||
assert.deepEqual(actual, ['a', 'c'], 'fp.without');
|
assert.deepEqual(actual, ['a', 'c'], 'fp.without');
|
||||||
|
|
||||||
actual = fp.xor(other)(array);
|
actual = fp.xor(other)(array);
|
||||||
|
|||||||
Reference in New Issue
Block a user