mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Use const for key in hasPath.
This commit is contained in:
@@ -16,13 +16,12 @@ import toKey from './toKey.js'
|
|||||||
function hasPath(object, path, hasFunc) {
|
function hasPath(object, path, hasFunc) {
|
||||||
path = castPath(path, object)
|
path = castPath(path, object)
|
||||||
|
|
||||||
let key
|
|
||||||
let index = -1
|
let index = -1
|
||||||
let length = path.length
|
let length = path.length
|
||||||
let result = false
|
let result = false
|
||||||
|
|
||||||
while (++index < length) {
|
while (++index < length) {
|
||||||
key = toKey(path[index])
|
const key = toKey(path[index])
|
||||||
if (!(result = object != null && hasFunc(object, key))) {
|
if (!(result = object != null && hasFunc(object, key))) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user