From b61d30da1a09a6a04735a4948afbe0b4515b2cb4 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 16 Mar 2016 21:30:48 -0700 Subject: [PATCH] Make `fp.without` an alias of `fp.difference`. [closes #2122] --- fp/_mapping.js | 4 +++- test/test-fp.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fp/_mapping.js b/fp/_mapping.js index 1a0c09aec..a83dcf491 100644 --- a/fp/_mapping.js +++ b/fp/_mapping.js @@ -36,6 +36,7 @@ exports.aliasToReal = { 'unnest': 'flatten', 'useWith': 'overArgs', 'whereEq': 'filter', + 'without': 'difference', 'zipObj': 'zipObject' }; @@ -163,7 +164,8 @@ exports.methodSpread = { 'invokeArgs': 2, 'invokeArgsMap': 2, 'partial': 1, - 'partialRight': 1 + 'partialRight': 1, + 'without': 1 }; /** Used to identify methods which mutate arrays or objects. */ diff --git a/test/test-fp.js b/test/test-fp.js index baaedd2e6..027b8a9e3 100644 --- a/test/test-fp.js +++ b/test/test-fp.js @@ -471,7 +471,7 @@ assert.expect(10); var array = ['a', 'b', 'c'], - other = ['b', 'b', 'd'], + other = ['b', 'd', 'b'], object = { 'a': 1, 'b': 2, 'c': 2 }, actual = fp.difference(array)(other); @@ -495,7 +495,7 @@ actual = fp.uniqBy(_.identity, other); assert.deepEqual(actual, ['b', 'd'], 'fp.uniqBy'); - actual = fp.without('b')(array); + actual = fp.without(array)(other); assert.deepEqual(actual, ['a', 'c'], 'fp.without'); actual = fp.xor(other)(array);