UNPKG

@qvant/qui-max

Version:

A Vue 3 Design system for Web.

25 lines (24 loc) 816 B
import castPath from "./_castPath.js"; import isArguments from "./isArguments.js"; import isArray from "./isArray.js"; import isIndex from "./_isIndex.js"; import isLength from "./isLength.js"; import toKey from "./_toKey.js"; 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)); } export { hasPath as default }; //# sourceMappingURL=_hasPath.js.map