@neon/tools 2.14.1 → 2.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/result.d.ts.map +1 -1
- package/dist/lib/result.js +1 -0
- package/package.json +1 -1
package/dist/lib/result.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/lib/result.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../../src/lib/result.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA8C/D,eAAO,MAAM,YAAY,GAAU,KAAK,EACvC,OAAO,KAAK,KACV,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAExC,CAAC"}
|
package/dist/lib/result.js
CHANGED
|
@@ -7,6 +7,7 @@ async function toJsonSafe(value) {
|
|
|
7
7
|
if (value instanceof Blob) return encodeBlob(value);
|
|
8
8
|
if (value instanceof Date) return value.toISOString();
|
|
9
9
|
if (Array.isArray(value)) return Promise.all(value.map(toJsonSafe));
|
|
10
|
+
if (typeof value === "object" && "toJSON" in value && typeof value.toJSON === "function") return toJsonSafe(value.toJSON());
|
|
10
11
|
if (typeof value === "object") {
|
|
11
12
|
const entries = await Promise.all(Object.entries(value).map(async ([key, child]) => [key, await toJsonSafe(child)]));
|
|
12
13
|
return Object.fromEntries(entries);
|