Sha256: da125f69db505ccfd4dcd6d6a7319144fb8b51641c6ee05482e6d8cb6ac6f4b6

Contents?: true

Size: 793 Bytes

Versions: 302

Compression:

Stored size: 793 Bytes

Contents

var baseProperty = require('./_baseProperty'),
    basePropertyDeep = require('./_basePropertyDeep'),
    isKey = require('./_isKey'),
    toKey = require('./_toKey');

/**
 * Creates a function that returns the value at `path` of a given object.
 *
 * @static
 * @memberOf _
 * @since 2.4.0
 * @category Util
 * @param {Array|string} path The path of the property to get.
 * @returns {Function} Returns the new accessor function.
 * @example
 *
 * var objects = [
 *   { 'a': { 'b': 2 } },
 *   { 'a': { 'b': 1 } }
 * ];
 *
 * _.map(objects, _.property('a.b'));
 * // => [2, 1]
 *
 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
 * // => [1, 2]
 */
function property(path) {
  return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}

module.exports = property;

Version data entries

302 entries across 279 versions & 33 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/property.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/property.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/property.js
immosquare-cleaner-0.1.60 node_modules/lodash/property.js
immosquare-cleaner-0.1.59 node_modules/lodash/property.js
immosquare-cleaner-0.1.58 node_modules/lodash/property.js
immosquare-cleaner-0.1.57 node_modules/lodash/property.js
immosquare-cleaner-0.1.56 node_modules/lodash/property.js
immosquare-cleaner-0.1.55 node_modules/lodash/property.js
immosquare-cleaner-0.1.54 node_modules/lodash/property.js
immosquare-cleaner-0.1.53 node_modules/lodash/property.js
immosquare-cleaner-0.1.52 node_modules/lodash/property.js
trusty-cms-6.3.1 node_modules/lodash/property.js
immosquare-cleaner-0.1.51 node_modules/lodash/property.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/property.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/property.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/property.js
immosquare-cleaner-0.1.50 node_modules/lodash/property.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/property.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/property.js