![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | arrays/ | 2 years ago | - | |
![]() | dist/ | 2 years ago | - | |
![]() | objects/ | 2 years ago | - | |
![]() | LICENSE | 40 years ago | 1.1K | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
![]() | README.md | 40 years ago | 1.1K | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
![]() | package.json | 2 years ago | 2.9K |
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