mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 09:27:49 +00:00
Bump to v4.0.0.
This commit is contained in:
30
isMatch.js
Normal file
30
isMatch.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import baseIsMatch from './internal/baseIsMatch';
|
||||
import getMatchData from './internal/getMatchData';
|
||||
|
||||
/**
|
||||
* Performs a deep comparison between `object` and `source` to determine if
|
||||
* `object` contains equivalent property values.
|
||||
*
|
||||
* **Note:** This method supports comparing the same values as `_.isEqual`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Lang
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {Object} source The object of property values to match.
|
||||
* @returns {boolean} Returns `true` if `object` is a match, else `false`.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'user': 'fred', 'age': 40 };
|
||||
*
|
||||
* _.isMatch(object, { 'age': 40 });
|
||||
* // => true
|
||||
*
|
||||
* _.isMatch(object, { 'age': 36 });
|
||||
* // => false
|
||||
*/
|
||||
function isMatch(object, source) {
|
||||
return object === source || baseIsMatch(object, source, getMatchData(source));
|
||||
}
|
||||
|
||||
export default isMatch;
|
||||
Reference in New Issue
Block a user