Sha256: b9c237a143ee8278341c987c84767b3c8b38073e1a773b0acb2768a0ba9178d5

Contents?: true

Size: 957 Bytes

Versions: 153

Compression:

Stored size: 957 Bytes

Contents

var baseClone = require('../internal/baseClone'),
    baseMatchesProperty = require('../internal/baseMatchesProperty');

/**
 * Creates a function that compares the property value of `path` on a given
 * object to `value`.
 *
 * **Note:** This method supports comparing arrays, booleans, `Date` objects,
 * numbers, `Object` objects, regexes, and strings. Objects are compared by
 * their own, not inherited, enumerable properties.
 *
 * @static
 * @memberOf _
 * @category Utility
 * @param {Array|string} path The path of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new function.
 * @example
 *
 * var users = [
 *   { 'user': 'barney' },
 *   { 'user': 'fred' }
 * ];
 *
 * _.find(users, _.matchesProperty('user', 'fred'));
 * // => { 'user': 'fred' }
 */
function matchesProperty(path, srcValue) {
  return baseMatchesProperty(path, baseClone(srcValue, true));
}

module.exports = matchesProperty;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
ilog-0.4.1 node_modules/contents/node_modules/lodash/utility/matchesProperty.js
ilog-0.4.1 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/utility/matchesProperty.js
ilog-0.4.1 node_modules/babel/node_modules/lodash/utility/matchesProperty.js
ilog-0.4.0 node_modules/babel/node_modules/lodash/utility/matchesProperty.js
ilog-0.4.0 node_modules/contents/node_modules/lodash/utility/matchesProperty.js
ilog-0.4.0 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/utility/matchesProperty.js
ilog-0.3.3 node_modules/babel/node_modules/lodash/utility/matchesProperty.js
ilog-0.3.3 node_modules/contents/node_modules/lodash/utility/matchesProperty.js
ilog-0.3.3 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/utility/matchesProperty.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/inquirer/node_modules/lodash/utility/matchesProperty.js