merkle-json
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "merkle-json", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Compute hash of Javascript object having optional Merkle hash tags", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -69,3 +69,3 @@ # merkle-json | ||
merkleHash: e77b735125fec27a61c6f54b17fb6221, // ignored | ||
}); // 441e4f8dabdc6cb17dc9500cee73155b | ||
}, useMerkleHash); // 441e4f8dabdc6cb17dc9500cee73155b | ||
``` |
@@ -225,3 +225,20 @@ (typeof describe === 'function') && describe("MerkleJson", function() { | ||
}); | ||
it("stringify(obj) honors toJSON() method of object", function() { | ||
var mj = new MerkleJson(); | ||
class TestObj { | ||
constructor(a) { | ||
this.a = a; | ||
this.random = Math.random(); | ||
} | ||
toJSON() { | ||
return { | ||
a: this.a, | ||
} | ||
} | ||
} | ||
var obj = new TestObj(1,2); | ||
should(mj.stringify(obj)).equal('{"a":1}'); | ||
}); | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32195
687