Skip to content

Commit

Permalink
Slightly improve performances for set() and update dev dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocasciaro committed Oct 10, 2020
1 parent b45fb77 commit b43cc8c
Show file tree
Hide file tree
Showing 4 changed files with 2,782 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ npm-debug.log
generated
coverage
.DS_Store
.nyc_output
11 changes: 9 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,15 @@
}, {});
};

function hasShallowProperty(obj, prop) {
return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop))
var hasShallowProperty
if (options.includeInheritedProps) {
hasShallowProperty = function () {
return true
}
} else {
hasShallowProperty = function (obj, prop) {
return (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)
}
}

function getShallowProperty(obj, prop) {
Expand Down
Loading

0 comments on commit b43cc8c

Please sign in to comment.