]> git.codecow.com Git - libnemo.git/commitdiff
Allow data containing bigints to be stored in safe.
authorChris Duncan <chris@zoso.dev>
Mon, 14 Jul 2025 16:44:13 +0000 (09:44 -0700)
committerChris Duncan <chris@zoso.dev>
Mon, 14 Jul 2025 16:44:13 +0000 (09:44 -0700)
src/lib/workers/safe.ts

index 159f4e7d1eca206c28ad34d9c4db87a746d57efd..232fd7451100f921fca6e47295706ed0d0782d7c 100644 (file)
@@ -187,7 +187,7 @@ export class Safe extends WorkerInterface {
                }
                if (typeof data === 'object') {
                        try {
-                               JSON.stringify(data)
+                               JSON.stringify(data, (k, v) => typeof v === 'bigint' ? v.toString() : v)
                        } catch (err) {
                                return true
                        }