isEqual.js 986 B

123456789101112131415161718192021222324252627282930313233343536
  1. var baseIsEqual = require('./_baseIsEqual');
  2. /**
  3. * Performs a deep comparison between two values to determine if they are
  4. * equivalent.
  5. *
  6. * **Note:** This method supports comparing arrays, array buffers, booleans,
  7. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  8. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  9. * by their own, not inherited, enumerable properties. Functions and DOM
  10. * nodes are compared by strict equality, i.e. `===`.
  11. *
  12. * @static
  13. * @memberOf _
  14. * @since 0.1.0
  15. * @category Lang
  16. * @param {*} value The value to compare.
  17. * @param {*} other The other value to compare.
  18. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  19. * @example
  20. *
  21. * var object = { 'a': 1 };
  22. * var other = { 'a': 1 };
  23. *
  24. * _.isEqual(object, other);
  25. * // => true
  26. *
  27. * object === other;
  28. * // => false
  29. */
  30. function isEqual(value, other) {
  31. return baseIsEqual(value, other);
  32. }
  33. module.exports = isEqual;