From 262f09533d23d05bd24539a0da63301daa03556b Mon Sep 17 00:00:00 2001 From: Jordan Jones Date: Thu, 9 Nov 2023 01:59:37 -0800 Subject: [PATCH] jesus christ --- src/server/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/server/index.ts b/src/server/index.ts index 9f268dcc6..98ea0a4e8 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -28,6 +28,12 @@ const logger = Logger.get('server'); const server = fastify(genFastifyOpts()); +// Normally I would never condone this, but I lack the patience to deal with this correctly. +// This is just to get JSON.stringify to globally serialize BigInt's +BigInt.prototype['toJSON'] = function () { + return this.toString(); +}; + if (dev) { server.addHook('onRoute', (opts) => { logger.child('route').debug(JSON.stringify(opts));