Sha256: 97c5e6d3e75bad40d57c3d0e56c28797c81aa1db5963531a7c64c0e56fb6b110

Contents?: true

Size: 884 Bytes

Versions: 274

Compression:

Stored size: 884 Bytes

Contents

var baseGet = require('./_baseGet');

/**
 * Gets the value at `path` of `object`. If the resolved value is
 * `undefined`, the `defaultValue` is returned in its place.
 *
 * @static
 * @memberOf _
 * @since 3.7.0
 * @category Object
 * @param {Object} object The object to query.
 * @param {Array|string} path The path of the property to get.
 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
 * @returns {*} Returns the resolved value.
 * @example
 *
 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
 *
 * _.get(object, 'a[0].b.c');
 * // => 3
 *
 * _.get(object, ['a', '0', 'b', 'c']);
 * // => 3
 *
 * _.get(object, 'a.b.c', 'default');
 * // => 'default'
 */
function get(object, path, defaultValue) {
  var result = object == null ? undefined : baseGet(object, path);
  return result === undefined ? defaultValue : result;
}

module.exports = get;

Version data entries

274 entries across 272 versions & 30 rubygems

Version Path
clapton-0.0.1 lib/clapton/javascripts/node_modules/lodash/get.js
immosquare-cleaner-0.1.47 node_modules/lodash/get.js
immosquare-cleaner-0.1.46 node_modules/lodash/get.js
immosquare-cleaner-0.1.45 node_modules/lodash/get.js
immosquare-cleaner-0.1.44 node_modules/lodash/get.js
boring_generators-0.14.0 tmp/templates/app_template/node_modules/lodash/get.js
immosquare-cleaner-0.1.43 node_modules/lodash/get.js
immosquare-cleaner-0.1.42 node_modules/lodash/get.js
immosquare-cleaner-0.1.41 node_modules/lodash/get.js
immosquare-cleaner-0.1.40 node_modules/lodash/get.js
sumomo-0.10.8 data/sumomo/api_modules/node_modules/lodash/get.js
immosquare-cleaner-0.1.39 node_modules/lodash/get.js
immosquare-cleaner-0.1.38 node_modules/lodash/get.js
optimacms-0.1.61 spec/dummy/node_modules/lodash/get.js
boring_generators-0.13.0 tmp/templates/app_template/node_modules/lodash/get.js
immosquare-cleaner-0.1.32 node_modules/lodash/get.js
immosquare-cleaner-0.1.31 node_modules/lodash/get.js
immosquare-cleaner-0.1.30 node_modules/lodash/get.js
immosquare-cleaner-0.1.29 node_modules/lodash/get.js
immosquare-cleaner-0.1.28 node_modules/lodash/get.js