1 var baseIsMatch = require('./internal/baseIsMatch'),
2 getMatchData = require('./internal/getMatchData');
5 * This method is like `_.isMatch` except that it accepts `customizer` which
6 * is invoked to compare values. If `customizer` returns `undefined` comparisons
7 * are handled by the method instead. The `customizer` is invoked with five
8 * arguments: (objValue, srcValue, index|key, object, source).
13 * @param {Object} object The object to inspect.
14 * @param {Object} source The object of property values to match.
15 * @param {Function} [customizer] The function to customize comparisons.
16 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
19 * function isGreeting(value) {
20 * return /^h(?:i|ello)$/.test(value);
23 * function customizer(objValue, srcValue) {
24 * if (isGreeting(objValue) && isGreeting(srcValue)) {
29 * var object = { 'greeting': 'hello' };
30 * var source = { 'greeting': 'hi' };
32 * _.isMatchWith(object, source, customizer);
35 function isMatchWith(object, source, customizer) {
36 customizer = typeof customizer == 'function' ? customizer : undefined;
37 return baseIsMatch(object, source, getMatchData(source), customizer);
40 module.exports = isMatchWith;