CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
isEqualWith.js42 linesDownload Raw Back to lodash-es
1import baseIsEqual from './_baseIsEqual.js';2 3/**4 * This method is like `_.isEqual` except that it accepts `customizer` which5 * is invoked to compare values. If `customizer` returns `undefined`, comparisons6 * are handled by the method instead. The `customizer` is invoked with up to7 * six arguments: (objValue, othValue [, index|key, object, other, stack]).8 *9 * @static10 * @memberOf _11 * @since 4.0.012 * @category Lang13 * @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 * @example18 *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 * // => true34 */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;42 
basant307/AI_Governance_Project · CoolFace