Comparing version 0.0.51 to 0.0.52
@@ -13,3 +13,3 @@ import { addContextToErr } from "./err.js"; | ||
if (typeof v === "bigint") { | ||
return v.toString(); | ||
return Number(v); | ||
} | ||
@@ -16,0 +16,0 @@ return v; |
@@ -30,5 +30,11 @@ // tryStringify will try to turn the provided input into a string. If the input | ||
// If the object does not have a custom toString, attempt to perform a | ||
// JSON.stringify. | ||
// JSON.stringify. We add custom handling for bigints so that objects with | ||
// bigints in them can still be stringified. | ||
try { | ||
return JSON.stringify(obj); | ||
return JSON.stringify(obj, (_, v) => { | ||
if (typeof v === "bigint") { | ||
return v.toString() + "n"; | ||
} | ||
return v; | ||
}); | ||
} | ||
@@ -35,0 +41,0 @@ catch { |
{ | ||
"name": "libskynet", | ||
"version": "0.0.51", | ||
"version": "0.0.52", | ||
"author": "Skynet Labs", | ||
@@ -5,0 +5,0 @@ "description": "helper library to interact with skynet's low level primitives", |
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
184443
66
5429
2