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
disco_app-0.18.2 test/dummy/node_modules/lodash/propertyOf.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
trusty-cms-5.0.7 node_modules/lodash/propertyOf.js
appmap-0.72.2 ./node_modules/lodash/propertyOf.js
trusty-cms-5.0.6 node_modules/lodash/propertyOf.js
appmap-0.72.1 ./node_modules/lodash/propertyOf.js
appmap-0.72.0 ./node_modules/lodash/propertyOf.js
trusty-cms-5.0.5 node_modules/lodash/propertyOf.js
trusty-cms-5.0.4 node_modules/lodash/propertyOf.js
appmap-0.71.0 ./node_modules/lodash/propertyOf.js
disco_app-0.16.1 test/dummy/node_modules/lodash/propertyOf.js
appmap-0.70.2 ./node_modules/lodash/propertyOf.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
appmap-0.70.1 ./node_modules/lodash/propertyOf.js
appmap-0.70.0 ./node_modules/lodash/propertyOf.js
appmap-0.69.0 ./node_modules/lodash/propertyOf.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
appmap-0.68.2 ./node_modules/lodash/propertyOf.js
appmap-0.68.1 ./node_modules/lodash/propertyOf.js
disco_app-0.15.2 test/dummy/node_modules/lodash/propertyOf.js