Skip to content

Commit

Permalink
Small improvement in utils/pick (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielcaldas authored Jul 12, 2018
1 parent 95a9ebb commit 00b1dfa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ function merge(o1 = {}, o2 = {}, _depth = 0) {
* @returns {Object} the object resultant from the picking operation.
* @memberof utils
*/
function pick(o, props) {
return Object.keys(o).reduce((acc, k) => {
if (o.hasOwnProperty(k) && props.includes(k)) {
function pick(o, props = []) {
return props.reduce((acc, k) => {
if (o.hasOwnProperty(k)) {
acc[k] = o[k];
}

Expand Down

0 comments on commit 00b1dfa

Please sign in to comment.