deep-eq-skip

1.0.6 • Public • Published

deep-eq-skip

Build Status npm npm GitHub

Validates two jsons with skipping keys

Give us a if you like our work ❤️

Install

$ npm install deep-eq-skip --save

Usage

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

Read our contributing guide on getting started with contributing to the codebase

Contributors

Thank you to all the contributors who have helped us in making this project better 🙌

Package Sidebar

Install

npm i deep-eq-skip

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

5.87 kB

Total Files

4

Last publish

Collaborators

  • arshadkazmi42