json-is-equal

Compare two JSON and return the result

MIT 1 个版本
安装
npm install json-is-equal
yarn add json-is-equal
pnpm add json-is-equal
bun add json-is-equal
README

json-is-equal

Build Status Dependency status Dev Dependencies Status NPM Status Gittip

Compare two JSON and return the result

Because JSON is represented in JavaScript Object Notation, but isn't not the same. While in an object the order of the keys is not important, in a JSON is important.

Install

npm install json-is-equal

If you want to use in the browser (powered by Browserify):

bower install json-is-equal --save

and later link in your HTML:

<script src="bower_components/json-is-equal/dist/json-is-equal.js"></script>

Usage

var isEqual = require('json-is-equal');
var objt1 = {
  foo: 'bar',
  hello: 'world'
};
var objt2 = {
  hello: 'world',
  foo: 'bar'
};
console.log(isEqual(objt1, objt2));
// => false

License

MIT © Kiko Beats

版本列表
1.0.0 2015-03-20