Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

is-equal

v4.17.11arrow_drop_down
v4.17.11
STATUS
Passing
DOWNLOADS
202
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
A year ago
SIZE
N/A
Performs a deep comparison between two values to determine if they are
1 contributor
Install is-equal as a package?
Copied
npm i @bit/lodash.lodash.is-equal
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
isEqual.js
35 Lines(5 sloc)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import baseIsEqual from './_baseIsEqual.js';

/**
 * Performs a deep comparison between two values to determine if they are
 * equivalent.
 *
 * **Note:** This method supports comparing arrays, array buffers, booleans,
 * date objects, error objects, maps, numbers, `Object` objects, regexes,
 * sets, strings, symbols, and typed arrays. `Object` objects are compared
 * by their own, not inherited, enumerable properties. Functions and DOM
 * nodes are compared by strict equality, i.e. `===`.
 *
 * @static
 * @memberOf _
 * @since 0.1.0
 * @category Lang
 * @param {*} value The value to compare.
 * @param {*} other The other value to compare.
 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
 * @example
 *
 * var object = { 'a': 1 };
 * var other = { 'a': 1 };
 *
 * _.isEqual(object, other);
 * // => true
 *
 * object === other;
 * // => false
 */
function isEqual(value, other) {
  return baseIsEqual(value, other);
}

export default isEqual;