https://github.com/arshadkazmi42/deep-eq-skip
Validates two jsons with skipping keys
https://github.com/arshadkazmi42/deep-eq-skip
array array-equal deep-equal equal json object object-equal string-equal
Last synced: 7 months ago
JSON representation
Validates two jsons with skipping keys
- Host: GitHub
- URL: https://github.com/arshadkazmi42/deep-eq-skip
- Owner: arshadkazmi42
- License: mit
- Created: 2019-02-23T07:44:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-07-27T13:41:30.000Z (over 3 years ago)
- Last Synced: 2025-08-03T20:14:32.776Z (7 months ago)
- Topics: array, array-equal, deep-equal, equal, json, object, object-equal, string-equal
- Language: JavaScript
- Size: 114 KB
- Stars: 2
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# deep-eq-skip
[](https://github.com/arshadkazmi42/deep-eq-skip/actions/workflows/nodejs.yml)
[](https://www.npmjs.com/package/deep-eq-skip)
[](https://www.npmjs.com/package/deep-eq-skip)
[](https://github.com/arshadkazmi42/deep-eq-skip)
[](https://github.com/arshadkazmi42/deep-eq-skip/blob/master/LICENSE)
[](https://github.com/arshadkazmi42/deep-eq-skip/graphs/contributors)
[](https://github.com/arshadkazmi42/deep-eq-skip/commits/master)
Validates two jsons with skipping keys
> Give us a :star: if you like our work :heart:
## Install
```
$ npm install deep-eq-skip --save
```
## Usage
```javascript
const deepEqSkip = require('deep-eq-skip');
const GIVEN_JSON = {
'name': 'deep-eq-skip',
'author': 'Arshad Kazmi',
'repository': {
'url': 'https://github.com/arshadkazmi42/deep-eq-skip',
'language': 'js'
}
};
const EXPECTED_JSON = {
'name': 'deep-equal-skip',
'author': 'Arshad Kazmi',
'repository': {
'url': 'https://github.com/arshadkazmi42/deep-equal-skip',
'language': 'js'
}
};
const isEqual = deepEqSkip(GIVEN_JSON, EXPECTED_JSON, ['name', 'url']);
// Output -> true
const isEqual = deepEqSkip(GIVEN_JSON, EXPECTED_JSON, []);
// Throws error: Expected "deep-equal-skip" found "deep-eq-skip"
const isEqual = deepEqSkip([1, 2, 3], { name: 1});
// Throws error: Expected undefined found 1
const isEqual = deepEqSkip('deep-eq-skip', 'deep-eq-skip');
// Output -> true
```
## Contributing
Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/deep-eq-skip/issues/new)
Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase