![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | arrays/ | 2 years ago | - | |
![]() | dist/ | 2 years ago | - | |
![]() | objects/ | 2 years ago | - | |
![]() | LICENSE | 39 years ago | 1.1K | 7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك] |
![]() | README.md | 39 years ago | 1.1K | f12eb36 documentaiton updates [كارل مبارك] |
![]() | package.json | 2 years ago | 2.9K | 7375cab EXHIBTION: fix overflow ellipsis cutoff [كارل مبارك] |
If you know you have two arrays or two objects in hand, and you want to know if they are shallowly equal or not, this library is for you.
npm install shallow-equal --save
import { shallowEqualArrays } from "shallow-equal";
shallowEqualArrays([1, 2, 3], [1, 2, 3]); // => true
shallowEqualArrays([{ a: 5 }], [{ a: 5 }]); // => false
import { shallowEqualObjects } from "shallow-equal";
shallowEqualObjects({ a: 5, b: "abc" }, { a: 5, b: "abc" }); // => true
shallowEqualObjects({ a: 5, b: {} }, { a: 5, b: {} }); // => false