source: trip-planner-front/node_modules/lodash/isMatchWith.js@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.3 KB
Line 
1var baseIsMatch = require('./_baseIsMatch'),
2 getMatchData = require('./_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 * @since 4.0.0
13 * @category Lang
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`.
18 * @example
19 *
20 * function isGreeting(value) {
21 * return /^h(?:i|ello)$/.test(value);
22 * }
23 *
24 * function customizer(objValue, srcValue) {
25 * if (isGreeting(objValue) && isGreeting(srcValue)) {
26 * return true;
27 * }
28 * }
29 *
30 * var object = { 'greeting': 'hello' };
31 * var source = { 'greeting': 'hi' };
32 *
33 * _.isMatchWith(object, source, customizer);
34 * // => true
35 */
36function isMatchWith(object, source, customizer) {
37 customizer = typeof customizer == 'function' ? customizer : undefined;
38 return baseIsMatch(object, source, getMatchData(source), customizer);
39}
40
41module.exports = isMatchWith;
Note: See TracBrowser for help on using the repository browser.