X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2FmatchesProperty.js;fp=node_modules%2Fgrunt-legacy-util%2Fnode_modules%2Flodash%2FmatchesProperty.js;h=d4356fb956a015d3d37fe0da28113c3f1a23b60c;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/node_modules/grunt-legacy-util/node_modules/lodash/matchesProperty.js b/node_modules/grunt-legacy-util/node_modules/lodash/matchesProperty.js new file mode 100644 index 000000000..d4356fb95 --- /dev/null +++ b/node_modules/grunt-legacy-util/node_modules/lodash/matchesProperty.js @@ -0,0 +1,31 @@ +var baseClone = require('./_baseClone'), + baseMatchesProperty = require('./_baseMatchesProperty'); + +/** + * Creates a function that performs a deep partial comparison between the + * value at `path` of a given object to `srcValue`, returning `true` if the + * object value is equivalent, else `false`. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @category Util + * @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;