Sha256: 286717d725444b78b405739515e9554fe37b4e8def457344d73c619f0414e167

Contents?: true

Size: 1.13 KB

Versions: 152

Compression:

Stored size: 1.13 KB

Contents

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

/** Used to compose bitmasks for cloning. */
var CLONE_DEEP_FLAG = 1;

/**
 * Creates a function that performs a partial deep comparison between the
 * value at `path` of a given object to `srcValue`, returning `true` if the
 * object value is equivalent, else `false`.
 *
 * **Note:** Partial comparisons will match empty array and empty object
 * `srcValue` values against any array or object value, respectively. See
 * `_.isEqual` for a list of supported value comparisons.
 *
 * @static
 * @memberOf _
 * @since 3.2.0
 * @category Util
 * @param {Array|string} path The path of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new spec function.
 * @example
 *
 * var objects = [
 *   { 'a': 1, 'b': 2, 'c': 3 },
 *   { 'a': 4, 'b': 5, 'c': 6 }
 * ];
 *
 * _.find(objects, _.matchesProperty('a', 4));
 * // => { 'a': 4, 'b': 5, 'c': 6 }
 */
function matchesProperty(path, srcValue) {
  return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
}

module.exports = matchesProperty;

Version data entries

152 entries across 152 versions & 19 rubygems

Version Path
sumomo-0.10.8 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.10.4 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.10.3 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.10.2 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.10.1 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.10.0 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
disco_app-0.18.0 test/dummy/node_modules/lodash/matchesProperty.js
disco_app-0.18.2 test/dummy/node_modules/lodash/matchesProperty.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
disco_app-0.16.1 test/dummy/node_modules/lodash/matchesProperty.js
sumomo-0.8.14 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
sumomo-0.8.13 data/sumomo/api_modules/node_modules/lodash/matchesProperty.js
disco_app-0.15.2 test/dummy/node_modules/lodash/matchesProperty.js
disco_app-0.18.4 test/dummy/node_modules/lodash/matchesProperty.js