https://github.com/fabiospampinato/are-shallow-equal
Check if two values are shallowly equal to each other.
https://github.com/fabiospampinato/are-shallow-equal
check equal shallow
Last synced: 11 months ago
JSON representation
Check if two values are shallowly equal to each other.
- Host: GitHub
- URL: https://github.com/fabiospampinato/are-shallow-equal
- Owner: fabiospampinato
- License: mit
- Created: 2019-06-19T21:36:47.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T16:28:47.000Z (over 2 years ago)
- Last Synced: 2024-10-31T19:55:28.441Z (over 1 year ago)
- Topics: check, equal, shallow
- Language: TypeScript
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Are Shallow Equal
Check if two values are shallowly equal to each other.
## Install
```sh
npm install are-shallow-equal
```
## Usage
```ts
import areShallowEqual from 'are-shallow-equal';
// Let's compare two values for shallow equality
areShallowEqual ( 123, 123 ); // true
areShallowEqual ( { foo: 1 }, { foo: 1 } ); // true
areShallowEqual ( [1, 2, 3], [1, 2, 3] ); // true
areShallowEqual ( 123, 456 ); // false
areShallowEqual ( { foo: 1 }, { foo: 2 } ); // false
areShallowEqual ( [1, 2, 3], [1, 2] ); // false
```
## License
MIT © Fabio Spampinato