Sha256: 0b7a5a0e2670d0f96c40994e4cfd50a524deb9c3ca5d7484c644643bebe52b4a

Contents?: true

Size: 732 Bytes

Versions: 299

Compression:

Stored size: 732 Bytes

Contents

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

/**
 * The opposite of `_.property`; this method creates a function that returns
 * the value at a given path of `object`.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Util
 * @param {Object} object The object to query.
 * @returns {Function} Returns the new accessor function.
 * @example
 *
 * var array = [0, 1, 2],
 *     object = { 'a': array, 'b': array, 'c': array };
 *
 * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
 * // => [2, 0]
 *
 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
 * // => [2, 0]
 */
function propertyOf(object) {
  return function(path) {
    return object == null ? undefined : baseGet(object, path);
  };
}

module.exports = propertyOf;

Version data entries

299 entries across 276 versions & 32 rubygems

Version Path
clapton-0.0.19 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
immosquare-cleaner-0.1.49 node_modules/lodash/propertyOf.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
immosquare-cleaner-0.1.48 node_modules/lodash/propertyOf.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.6 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.5 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.4 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.3 lib/clapton/javascripts/node_modules/lodash/propertyOf.js
clapton-0.0.2 lib/clapton/javascripts/node_modules/lodash/propertyOf.js