Skip to content

Commit

Permalink
change default uniques behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Oct 20, 2018
1 parent 389e911 commit bf8ead9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/lib/uniques.js
@@ -1,4 +1,4 @@
export default function uniques (list, iteratee, transform = false) {
export default function uniques (list, iteratee, transform = true) {
if (!Array.isArray(list)) {
console.error('LayerCake error: Input value to `uniques` must be a list.');
return null;
Expand Down
9 changes: 4 additions & 5 deletions test/uniques.js
Expand Up @@ -13,23 +13,22 @@ const tests = [
{
args: [
[{x: 1, b: 2}, {x: 1, b: 3}, {x: 2, b: 4}],
'x'
'x',
false
],
expected: [{x: 1, b: 2}, {x: 2, b: 4}]
},
{
args: [
[{x: 1, b: 2}, {x: 1, b: 3}, {x: 2, b: 4}],
'x',
true
'x'
],
expected: [1, 2]
},
{
args: [
[{x: 1, b: 2}, {x: 1, b: 3}, {x: 2, b: 4}],
d => d.x,
true
d => d.x
],
expected: [1, 2]
}
Expand Down

0 comments on commit bf8ead9

Please sign in to comment.