Bump to v4.0.0.

This commit is contained in:
John-David Dalton
2015-09-17 17:52:09 -07:00
parent 1d77dfa4b7
commit 54e7baecc3
675 changed files with 11257 additions and 8085 deletions

31
matchesProperty.js Normal file
View File

@@ -0,0 +1,31 @@
import baseClone from './internal/baseClone';
import baseMatchesProperty from './internal/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));
}
export default matchesProperty;