Skip to content

Commit 9572a5e

Browse files
committed
use default value
1 parent 1c130ec commit 9572a5e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packages/objects/pickBy/pickBy.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
* });
6060
* // => {}
6161
*/
62-
const pickBy = (object, predicate, pickOwnKeys) => {
62+
const pickBy = (object, predicate, pickOwnKeys = true) => {
6363
const result = {};
6464
const type = Object.prototype.toString.call(object);
6565

@@ -79,10 +79,6 @@ const pickBy = (object, predicate, pickOwnKeys) => {
7979
throw new TypeError('Expected a function for second argument');
8080
}
8181

82-
if (typeof pickOwnKeys === 'undefined') {
83-
pickOwnKeys = true;
84-
}
85-
8682
if (typeof pickOwnKeys !== 'boolean') {
8783
throw new TypeError('Expected a boolean for third argument');
8884
}

0 commit comments

Comments
 (0)