X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2Fmatches.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2Fmatches.js;h=5a2926ae524e8a2041834c3decb7301938f61cb2;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/matches.js b/node_modules/grunt-legacy-util/node_modules/lodash/matches.js new file mode 100644 index 000000000..5a2926ae5 --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/matches.js @@ -0,0 +1,30 @@ +var baseClone = require('./_baseClone'), + baseMatches = require('./_baseMatches'); + +/** + * Creates a function that performs a deep partial comparison between a given + * object and `source`, returning `true` if the given object has equivalent + * property values, else `false`. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @category Util + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, _.matches({ 'age': 40, 'active': false })); + * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + */ +function matches(source) { + return baseMatches(baseClone(source, true)); +} + +module.exports = matches;