stable-serialize

0.0.4 • Public • Published

Stable Serialize

Consistent stringify and hash for deeply equal objects.

Usage

const serialize = require('stable-serialize');

let object1 = {};
let object2 = {};
object1.a = 'a';
object2.b = 'b';
object1.b = 'b';
object2.a = 'a';

expect(JSON.stringify(object1)).not.toBe(JSON.stringify(object2));
expect(serialize.stringify(object1)).toBe(serialize.stringify(object2));
expect(serialize.hash(object1)).toBe(serialize.hash(object2));

Readme

Keywords

none

Package Sidebar

Install

npm i stable-serialize

Weekly Downloads

4

Version

0.0.4

License

ISC

Unpacked Size

4.9 kB

Total Files

5

Last publish

Collaborators

  • jacoblee93