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
immosquare-cleaner-0.1.27 node_modules/lodash/propertyOf.js
immosquare-cleaner-0.1.26 node_modules/lodash/propertyOf.js
immosquare-cleaner-0.1.25 node_modules/lodash/propertyOf.js
immosquare-cleaner-0.1.24 node_modules/lodash/propertyOf.js
immosquare-cleaner-0.1.23 node_modules/lodash/propertyOf.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.10.1 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.10.0 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
reed_sdk-1.0.1 node_modules/lodash/propertyOf.js
reed_sdk-1.0.0 node_modules/lodash/propertyOf.js
boring_generators-0.12.0 tmp/templates/app_template/node_modules/lodash/propertyOf.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/propertyOf.js
disco_app-0.18.0 test/dummy/node_modules/lodash/propertyOf.js