source: imaps-frontend/node_modules/lodash-es/isEqualWith.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.3 KB
Line 
1import baseIsEqual from './_baseIsEqual.js';
2
3/**
4 * This method is like `_.isEqual` except that it accepts `customizer` which
5 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
6 * are handled by the method instead. The `customizer` is invoked with up to
7 * six arguments: (objValue, othValue [, index|key, object, other, stack]).
8 *
9 * @static
10 * @memberOf _
11 * @since 4.0.0
12 * @category Lang
13 * @param {*} value The value to compare.
14 * @param {*} other The other value to compare.
15 * @param {Function} [customizer] The function to customize comparisons.
16 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
17 * @example
18 *
19 * function isGreeting(value) {
20 * return /^h(?:i|ello)$/.test(value);
21 * }
22 *
23 * function customizer(objValue, othValue) {
24 * if (isGreeting(objValue) && isGreeting(othValue)) {
25 * return true;
26 * }
27 * }
28 *
29 * var array = ['hello', 'goodbye'];
30 * var other = ['hi', 'goodbye'];
31 *
32 * _.isEqualWith(array, other, customizer);
33 * // => true
34 */
35function isEqualWith(value, other, customizer) {
36 customizer = typeof customizer == 'function' ? customizer : undefined;
37 var result = customizer ? customizer(value, other) : undefined;
38 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
39}
40
41export default isEqualWith;
Note: See TracBrowser for help on using the repository browser.