json-structure
v0.2.0
Published
Compare the structure of two JSON objects
Downloads
3
Readme
JSONStructure
Install
npm install json-structureUsage
require('json-structure');
JSON.structure(json1).compare(json2);Example
var a = {x: '1'};
var b = {x: '2'};
JSON.structure(a).compare(b); // true
var a = {x: '1'};
var b = {x: 2};
JSON.structure(a).compare(b); // Error: x (wrong type)
var a = {x: '1'};
var b = {y: '2'};
JSON.structure(a).compare(b); // Error: x (missing value)Run the tests
npm test