Fix body not serializing because of bigint (#119)

* Fix body not serializing because of bigint

* Use cleaner JSON handling
This commit is contained in:
SleeplessOne1917 2023-05-12 13:07:54 +00:00 committed by GitHub
parent 968e1c0049
commit c66211f7c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -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",

View file

@ -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.
*