@bhbr/egalite
v1.2.0
Published
Functions for checking equality-by-value between objects or arrays
Readme
Description
Égalité (egalite) provides functions for checking whether two given variables, including arrays or objects, are equal by value. When used on non-objects, it works like strict equality (===).
Usage examples
> equal([1, 2], [1, 2])
true
> equalArrays([1, 2], [1, 2])
true
> equal([1, 2], [2, 1])
false
> equal({a: 1}, {a: 1})
true
> equalObjects({a: 1}, {a: 1})
true
> equal(null, 0)
falseInstallation
> npm install @bhbr/egalite