0.0.15 • Published 7 years ago

json-compare v0.0.15

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

json-match

Build Status Coverage Status Dependency Status bitHound Overall Score bitHound Code

NOTE: Currently does not support arrays

About

Compare two json object for matching deep keys, also supports regular-expression.

usage:

npm install json-compare
import compare from 'json-compare' // es6
// OR
const compare = require('json-compare') // good old es5

const source = {
    name: "Dave Amit",
    hobby: {
        game: 'The Division'
    },
    country: 'India',
};

const test = {
    name: /[a-zA-Z ]+/,
    hobby: {
        game: /Division/,
    },
    country: 'india',
};

const result = compare(source, test);
   // Result will be something like:

   {
    regExMatch: 2, // Because it matched 2 regular expressions
    exactMatch: 0, 
    fuzzyMatch: 1, // Because India to india match
    matchCount: 3, // Total keys matched
    mismatchCount: 0,
    unmatchedCount: 0,
    match: true,
    isExactMatch: false, // Because of fuzzyMatch
  }
0.0.15

7 years ago

0.0.14

7 years ago

0.0.12

7 years ago

0.0.13

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.8

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago