"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _castPath = require("./_castPath.js");
const isArguments = require("./isArguments.js");
const isArray = require("./isArray.js");
const _isIndex = require("./_isIndex.js");
const isLength = require("./isLength.js");
const _toKey = require("./_toKey.js");
function hasPath(object, path, hasFunc) {
  path = _castPath.default(path, object);
  var index = -1, length = path.length, result = false;
  while (++index < length) {
    var key = _toKey.default(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.default(length) && _isIndex.default(key, length) && (isArray.default(object) || isArguments.default(object));
}
exports.default = hasPath;
