X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=node_modules%2Fgrunt-legacy-log%2Fnode_modules%2Flodash%2Futility%2FmatchesProperty.js;fp=node_modules%2Fgrunt-legacy-log%2Fnode_modules%2Flodash%2Futility%2FmatchesProperty.js;h=91e51a56cbfbdbb1d6dd7680747ac3d349a3aa8b;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/node_modules/grunt-legacy-log/node_modules/lodash/utility/matchesProperty.js b/node_modules/grunt-legacy-log/node_modules/lodash/utility/matchesProperty.js new file mode 100644 index 000000000..91e51a56c --- /dev/null +++ b/node_modules/grunt-legacy-log/node_modules/lodash/utility/matchesProperty.js @@ -0,0 +1,32 @@ +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;