File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ function hasPath(object, path) {
31
31
path = castPath ( path , object )
32
32
33
33
let index = - 1
34
- let length = path . length
34
+ let { length } = path
35
35
let result = false
36
+ let key
36
37
37
38
while ( ++ index < length ) {
38
- const key = toKey ( path [ index ] )
39
+ key = toKey ( path [ index ] )
39
40
if ( ! ( result = object != null && hasOwnProperty . call ( object , key ) ) ) {
40
41
break
41
42
}
Original file line number Diff line number Diff line change @@ -28,11 +28,12 @@ function hasPathIn(object, path) {
28
28
path = castPath ( path , object )
29
29
30
30
let index = - 1
31
- let length = path . length
31
+ let { length } = path
32
32
let result = false
33
+ let key
33
34
34
35
while ( ++ index < length ) {
35
- const key = toKey ( path [ index ] )
36
+ key = toKey ( path [ index ] )
36
37
if ( ! ( result = object != null && key in Object ( object ) ) ) {
37
38
break
38
39
}
You can’t perform that action at this time.
0 commit comments