From d84ebbda072028d3dfadd07d92c38cbb76f5073e Mon Sep 17 00:00:00 2001 From: tnfAngel <57068341+tnfAngel@users.noreply.github.com> Date: Sun, 26 Nov 2023 23:33:50 +0000 Subject: [PATCH] Update responseMessage type (#5) * Update responseMessage type * Update README.md * chore: changeset --------- Co-authored-by: Phumrapee Limpianchop --- .changeset/tricky-keys-vanish.md | 5 +++++ README.md | 2 +- src/@types/Options.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/tricky-keys-vanish.md diff --git a/.changeset/tricky-keys-vanish.md b/.changeset/tricky-keys-vanish.md new file mode 100644 index 0000000..8bce769 --- /dev/null +++ b/.changeset/tricky-keys-vanish.md @@ -0,0 +1,5 @@ +--- +'elysia-rate-limit': patch +--- + +responseMessage type has been changed to `any`, so you can actually return response as anything (i.e. object) diff --git a/README.md b/README.md index 77f4653..821ee76 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ HTTP reponse code to be sent when rate limit was reached. By default, it will re ### responseMessage -`string` +`any` Default: `rate-limit reached` diff --git a/src/@types/Options.ts b/src/@types/Options.ts index 6156717..140f339 100644 --- a/src/@types/Options.ts +++ b/src/@types/Options.ts @@ -14,7 +14,7 @@ export interface Options { responseCode: number // message response when rate-limit reached (Default: rate-limit reached) - responseMessage: string + responseMessage: any // should rate limit being counted when request result is failed (Default: false) countFailedRequest: boolean