Comparing version
@@ -6,4 +6,5 @@ export { downloadSkylink } from "./apidownloadskylink.js"; | ||
export { verifyRegistryReadResponse, verifyRegistryWriteResponse } from "./apiregistryverify.js"; | ||
export { defaultPortalList } from "./apidefaultportals.js"; | ||
export { blake2b, BLAKE2B_HASH_SIZE } from "./blake2b.js"; | ||
export { defaultPortalList } from "./apidefaultportals.js"; | ||
export { checkObj } from "./checkObj.js"; | ||
export { dictionary } from "./dictionary.js"; | ||
@@ -10,0 +11,0 @@ export { Ed25519Keypair, ed25519KeypairFromEntropy, ed25519Sign, ed25519Verify } from "./ed25519.js"; |
@@ -6,4 +6,5 @@ export { downloadSkylink } from "./apidownloadskylink.js"; | ||
export { verifyRegistryReadResponse, verifyRegistryWriteResponse } from "./apiregistryverify.js"; | ||
export { defaultPortalList } from "./apidefaultportals.js"; | ||
export { blake2b, BLAKE2B_HASH_SIZE } from "./blake2b.js"; | ||
export { defaultPortalList } from "./apidefaultportals.js"; | ||
export { checkObj } from "./checkObj.js"; | ||
export { dictionary } from "./dictionary.js"; | ||
@@ -10,0 +11,0 @@ export { ed25519KeypairFromEntropy, ed25519Sign, ed25519Verify } from "./ed25519.js"; |
@@ -23,3 +23,3 @@ // tryStringify will try to turn the provided input into a string. If the input | ||
if (typeof obj.toString === "function") { | ||
let str = obj.toString() | ||
const str = obj.toString() | ||
if (typeof str === "string") { | ||
@@ -31,8 +31,9 @@ return str | ||
// If the object does not have a custom toString, attempt to perform a | ||
// JSON.stringify. We add custom handling for bigints so that objects with | ||
// bigints in them can still be stringified. | ||
// JSON.stringify. We use a lot of bigints in libskynet, and calling | ||
// JSON.stringify on an object with a bigint will cause a throw, so we add | ||
// some custom handling to allow bigint objects to still be encoded. | ||
try { | ||
return JSON.stringify(obj, (_, v) => { | ||
if (typeof v === "bigint") { | ||
return v.toString() + "n" | ||
return Number(v) | ||
} | ||
@@ -39,0 +40,0 @@ return v |
{ | ||
"name": "libskynet", | ||
"version": "0.0.61", | ||
"version": "0.0.62", | ||
"author": "Skynet Labs", | ||
@@ -5,0 +5,0 @@ "description": "helper library to interact with skynet's low level primitives", |
1
-50%180398
-4.58%66
-8.33%5373
-2.72%