1 var Stack = require('./_Stack'),
2 baseIsEqual = require('./_baseIsEqual');
4 /** Used to compose bitmasks for comparison styles. */
5 var UNORDERED_COMPARE_FLAG = 1,
6 PARTIAL_COMPARE_FLAG = 2;
9 * The base implementation of `_.isMatch` without support for iteratee shorthands.
12 * @param {Object} object The object to inspect.
13 * @param {Object} source The object of property values to match.
14 * @param {Array} matchData The property names, values, and compare flags to match.
15 * @param {Function} [customizer] The function to customize comparisons.
16 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
18 function baseIsMatch(object, source, matchData, customizer) {
19 var index = matchData.length,
21 noCustomizer = !customizer;
26 object = Object(object);
28 var data = matchData[index];
29 if ((noCustomizer && data[2])
30 ? data[1] !== object[data[0]]
31 : !(data[0] in object)
36 while (++index < length) {
37 data = matchData[index];
39 objValue = object[key],
42 if (noCustomizer && data[2]) {
43 if (objValue === undefined && !(key in object)) {
47 var stack = new Stack,
48 result = customizer ? customizer(objValue, srcValue, key, object, source, stack) : undefined;
50 if (!(result === undefined
51 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack)
61 module.exports = baseIsMatch;