mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Fixin scope range for var declarations in hasPath and hasPathIn.
This commit is contained in:
@@ -31,11 +31,12 @@ function hasPath(object, path) {
|
||||
path = castPath(path, object)
|
||||
|
||||
let index = -1
|
||||
let length = path.length
|
||||
let { length } = path
|
||||
let result = false
|
||||
let key
|
||||
|
||||
while (++index < length) {
|
||||
const key = toKey(path[index])
|
||||
key = toKey(path[index])
|
||||
if (!(result = object != null && hasOwnProperty.call(object, key))) {
|
||||
break
|
||||
}
|
||||
|
||||
@@ -28,11 +28,12 @@ function hasPathIn(object, path) {
|
||||
path = castPath(path, object)
|
||||
|
||||
let index = -1
|
||||
let length = path.length
|
||||
let { length } = path
|
||||
let result = false
|
||||
let key
|
||||
|
||||
while (++index < length) {
|
||||
const key = toKey(path[index])
|
||||
key = toKey(path[index])
|
||||
if (!(result = object != null && key in Object(object))) {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user