Fix bigint serialization error (#916)

## Description:

- JSON serialization, bigint to string handling
- JSON deserialization, string to bigint handling

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
Scott Anderson
2025-05-28 13:33:20 -04:00
committed by GitHub
parent 7926267791
commit 40932b9f5f
7 changed files with 28 additions and 16 deletions
+1 -7
View File
@@ -1,6 +1,7 @@
import { S3 } from "@aws-sdk/client-s3";
import { getServerConfigFromServer } from "../core/configuration/ConfigLoader";
import { AnalyticsRecord, GameID, GameRecord } from "../core/Schemas";
import { replacer } from "../core/Util";
import { logger } from "./Logger";
const config = getServerConfigFromServer();
@@ -147,10 +148,3 @@ export async function gameRecordExists(gameId: GameID): Promise<boolean> {
return false;
}
}
/**
* JSON.stringify replacer function that converts bigint values to strings.
*/
export function replacer(_key: string, value: any): any {
return typeof value === "bigint" ? value.toString() : value;
}