"use strict";
const _castPath = require("./_castPath.js");
const isArguments$1 = require("./isArguments.js");
const isArray$1 = require("./isArray.js");
const _isIndex = require("./_isIndex.js");
const isLength$1 = require("./isLength.js");
const _toKey = require("./_toKey.js");
var castPath = _castPath, isArguments = isArguments$1, isArray = isArray$1, isIndex = _isIndex, isLength = isLength$1, toKey = _toKey;
function hasPath(object, path, hasFunc) {
  path = castPath(path, object);
  var index = -1, length = path.length, result = false;
  while (++index < length) {
    var key = toKey(path[index]);
    if (!(result = object != null && hasFunc(object, key))) {
      break;
    }
    object = object[key];
  }
  if (result || ++index != length) {
    return result;
  }
  length = object == null ? 0 : object.length;
  return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
}
var _hasPath = hasPath;
module.exports = _hasPath;
//# sourceMappingURL=_hasPath.js.map
