1 var baseIsMatch = require('./_baseIsMatch'),
2 getMatchData = require('./_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).
14 * @param {Object} object The object to inspect.
15 * @param {Object} source The object of property values to match.
16 * @param {Function} [customizer] The function to customize comparisons.
17 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
20 * function isGreeting(value) {
21 * return /^h(?:i|ello)$/.test(value);
24 * function customizer(objValue, srcValue) {
25 * if (isGreeting(objValue) && isGreeting(srcValue)) {
30 * var object = { 'greeting': 'hello' };
31 * var source = { 'greeting': 'hi' };
33 * _.isMatchWith(object, source, customizer);
36 function isMatchWith(object, source, customizer) {
37 customizer = typeof customizer == 'function' ? customizer : undefined;
38 return baseIsMatch(object, source, getMatchData(source), customizer);
41 module.exports = isMatchWith;