Sha256: 18eeed6ed036410cddf9fc8b0bbe6ca932e4a714a8b650ca0e43df271d55c0aa

Contents?: true

Size: 1.12 KB

Versions: 152

Compression:

Stored size: 1.12 KB

Contents

var baseClone = require('./_baseClone'),
    baseMatches = require('./_baseMatches');

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

/**
 * Creates a function that performs a partial deep comparison between a given
 * object and `source`, returning `true` if the given object has equivalent
 * property values, else `false`.
 *
 * **Note:** The created function is equivalent to `_.isMatch` with `source`
 * partially applied.
 *
 * Partial comparisons will match empty array and empty object `source`
 * values against any array or object value, respectively. See `_.isEqual`
 * for a list of supported value comparisons.
 *
 * @static
 * @memberOf _
 * @since 3.0.0
 * @category Util
 * @param {Object} source The object of property values to match.
 * @returns {Function} Returns the new spec function.
 * @example
 *
 * var objects = [
 *   { 'a': 1, 'b': 2, 'c': 3 },
 *   { 'a': 4, 'b': 5, 'c': 6 }
 * ];
 *
 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
 * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
 */
function matches(source) {
  return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
}

module.exports = matches;

Version data entries

152 entries across 152 versions & 19 rubygems

Version Path
disco_app-0.18.1 test/dummy/node_modules/lodash/matches.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/lodash/matches.js
disco_app-0.14.0 test/dummy/node_modules/lodash/matches.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/lodash/matches.js
sumomo-0.8.12 data/sumomo/api_modules/node_modules/lodash/matches.js
sumomo-0.8.11 data/sumomo/api_modules/node_modules/lodash/matches.js
trusty-cms-4.3 node_modules/lodash/matches.js
sumomo-0.8.10 data/sumomo/api_modules/node_modules/lodash/matches.js
trusty-cms-4.2.2 node_modules/lodash/matches.js
trusty-cms-4.2.1 node_modules/lodash/matches.js
trusty-cms-4.2 node_modules/lodash/matches.js
trusty-cms-4.1.9 node_modules/lodash/matches.js
trusty-cms-4.1.8 node_modules/lodash/matches.js
trusty-cms-4.1.7 node_modules/lodash/matches.js
trusty-cms-4.1.6 node_modules/lodash/matches.js
trusty-cms-4.1.5 node_modules/lodash/matches.js
sumomo-0.8.9 data/sumomo/api_modules/node_modules/lodash/matches.js
enju_library-0.3.8 spec/dummy/node_modules/lodash/matches.js
condenser-0.3 lib/condenser/processors/node_modules/lodash/matches.js
sumomo-0.8.8 data/sumomo/api_modules/node_modules/lodash/matches.js