Code Monkey home page Code Monkey logo

deep-eq-skip's Introduction

deep-eq-skip

Build NPM Version NPM Downloads Github Repo Size LICENSE Contributors Commit

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

deep-eq-skip's People

Contributors

arshadkazmi42 avatar dependabot[bot] avatar hisman avatar jjalbuenacabuyao avatar manjeet04 avatar okandavut avatar xnocken avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

deep-eq-skip's Issues

add badges using npm-badger

  1. Install npm badger npm install npm-badger -g
  2. Clone this repository git clone https://github.com/arshadkazmi42/deep-eq-skip
  3. Go to root directory cd deep-eq-skip
  4. Run npm badger npm-badger
  5. Commit README.md file
  6. Create Pull Request

empty data and expected data is not checked.

In format, when an empty object or array is send, it does not goes to validation condition and returns true automatically.

Here this should not be the case, if data empty and expected data is available means it does not matches. This should thrown error

fix vulnerability

  • Delete package-lock.json
  • Run npm install
  • Commit package-lock.json
  • Create pull request

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.