1 var baseIsEqual = require('./baseIsEqual'),
2 toObject = require('./toObject');
5 * The base implementation of `_.isMatch` without support for callback
6 * shorthands and `this` binding.
9 * @param {Object} object The object to inspect.
10 * @param {Array} matchData The propery names, values, and compare flags to match.
11 * @param {Function} [customizer] The function to customize comparing objects.
12 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
14 function baseIsMatch(object, matchData, customizer) {
15 var index = matchData.length,
17 noCustomizer = !customizer;
22 object = toObject(object);
24 var data = matchData[index];
25 if ((noCustomizer && data[2])
26 ? data[1] !== object[data[0]]
27 : !(data[0] in object)
32 while (++index < length) {
33 data = matchData[index];
35 objValue = object[key],
38 if (noCustomizer && data[2]) {
39 if (objValue === undefined && !(key in object)) {
43 var result = customizer ? customizer(objValue, srcValue, key) : undefined;
44 if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
52 module.exports = baseIsMatch;