json-structure

0.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i json-structure

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • materik