Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/i18n / dist / cjs / node_modules / lodash / _hasPath.js
Size: Mime:
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var isArguments = require('./isArguments.js');
var isArray = require('./isArray.js');
var _isIndex = require('./_isIndex.js');
var isLength = require('./isLength.js');
var _castPath = require('./_castPath.js');
var _toKey = require('./_toKey.js');

/**
 * Checks if `path` exists on `object`.
 *
 * @private
 * @param {Object} object The object to query.
 * @param {Array|string} path The path to check.
 * @param {Function} hasFunc The function to check properties.
 * @returns {boolean} Returns `true` if `path` exists, else `false`.
 */
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));
}

var _hasPath = hasPath;

exports.__moduleExports = _hasPath;
exports.default = _hasPath;
//# sourceMappingURL=_hasPath.js.map