diff --git a/src/http.ts b/src/http.ts index bdec8ec..7f46f70 100644 --- a/src/http.ts +++ b/src/http.ts @@ -130,6 +130,11 @@ import { VerifyEmail } from "./types/VerifyEmail"; import { VerifyEmailResponse } from "./types/VerifyEmailResponse"; import { UploadImage, UploadImageResponse, VERSION } from "./types/others"; +// @ts-ignore +BigInt.prototype["toJSON"] = function () { + return this.toString(); +}; + enum HttpType { Get = "GET", Post = "POST", diff --git a/src/websocket.ts b/src/websocket.ts index a33add4..d661776 100644 --- a/src/websocket.ts +++ b/src/websocket.ts @@ -87,6 +87,11 @@ import { TransferCommunity } from "./types/TransferCommunity"; import { UserJoin } from "./types/UserJoin"; import { VerifyEmail } from "./types/VerifyEmail"; +// @ts-ignore +BigInt.prototype["toJSON"] = function () { + return this.toString(); +}; + /** * Helps build lemmy websocket message requests, that you can use in your Websocket sends. *