Added the Porter Stemmer module to improve searches. This doesn't deal with some...
[yaffs-website] / node_modules / uncss / node_modules / lodash / isMatchWith.js
1 var baseIsMatch = require('./internal/baseIsMatch'),
2     getMatchData = require('./internal/getMatchData');
3
4 /**
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).
9  *
10  * @static
11  * @memberOf _
12  * @category Lang
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`.
17  * @example
18  *
19  * function isGreeting(value) {
20  *   return /^h(?:i|ello)$/.test(value);
21  * }
22  *
23  * function customizer(objValue, srcValue) {
24  *   if (isGreeting(objValue) && isGreeting(srcValue)) {
25  *     return true;
26  *   }
27  * }
28  *
29  * var object = { 'greeting': 'hello' };
30  * var source = { 'greeting': 'hi' };
31  *
32  * _.isMatchWith(object, source, customizer);
33  * // => true
34  */
35 function isMatchWith(object, source, customizer) {
36   customizer = typeof customizer == 'function' ? customizer : undefined;
37   return baseIsMatch(object, source, getMatchData(source), customizer);
38 }
39
40 module.exports = isMatchWith;