0.2.0 • Published 9 years ago
json-structure v0.2.0
JSONStructure
Install
npm install json-structure
Usage
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