mirror of
https://github.com/Burn-E99/TheArtificer.git
synced 2026-01-06 20:37:54 -05:00
add missing toJSON field to bigints inside artigen's worker
This commit is contained in:
@ -8,6 +8,15 @@ import { loggingEnabled } from 'artigen/utils/logFlag.ts';
|
||||
|
||||
loggingEnabled && initLog('logs/worker', loggingEnabled);
|
||||
|
||||
// Extend the BigInt prototype to support JSON.stringify
|
||||
interface BigIntX extends BigInt {
|
||||
// Convert to BigInt to string form in JSON.stringify
|
||||
toJSON: () => string;
|
||||
}
|
||||
(BigInt.prototype as BigIntX).toJSON = function () {
|
||||
return this.toString();
|
||||
};
|
||||
|
||||
// Alert rollQueue that this worker is ready
|
||||
self.postMessage('ready');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user