Skip to content

Commit b43cc8c

Browse files
committed
Slightly improve performances for set() and update dev dependencies
1 parent b45fb77 commit b43cc8c

File tree

4 files changed

+2782
-8
lines changed

4 files changed

+2782
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ npm-debug.log
55
generated
66
coverage
77
.DS_Store
8+
.nyc_output

index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,15 @@
8383
}, {});
8484
};
8585

86-
function hasShallowProperty(obj, prop) {
87-
return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop))
86+
var hasShallowProperty
87+
if (options.includeInheritedProps) {
88+
hasShallowProperty = function () {
89+
return true
90+
}
91+
} else {
92+
hasShallowProperty = function (obj, prop) {
93+
return (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop)
94+
}
8895
}
8996

9097
function getShallowProperty(obj, prop) {

0 commit comments

Comments
 (0)