File tree 7 files changed +43
-3
lines changed
7 files changed +43
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " elysia-rate-limit " : patch
3
+ ---
4
+
5
+ seeding logic complexity reduction
Original file line number Diff line number Diff line change
1
+ ---
2
+ " elysia-rate-limit " : patch
3
+ ---
4
+
5
+ fix plugin duplication due to missing seed provided to Elysia instances
Original file line number Diff line number Diff line change
1
+ {
2
+ "mode" : " exit" ,
3
+ "tag" : " beta" ,
4
+ "initialVersions" : {
5
+ "elysia-rate-limit" : " 4.2.0"
6
+ },
7
+ "changesets" : [
8
+ " cuddly-bees-change" ,
9
+ " nice-pumas-sneeze"
10
+ ]
11
+ }
Original file line number Diff line number Diff line change 1
1
.git
2
2
.gitignore
3
- .prettierrc
4
3
bun.lockb
5
4
6
5
node_modules
Original file line number Diff line number Diff line change 1
1
# elysia-rate-limit
2
2
3
+ ## 4.2.1-beta.1
4
+
5
+ ### Patch Changes
6
+
7
+ - seeding logic complexity reduction
8
+
9
+ ## 4.2.1-beta.0
10
+
11
+ ### Patch Changes
12
+
13
+ - fix plugin duplication due to missing seed provided to Elysia instances
14
+
3
15
## 4.2.0
4
16
5
17
### Minor Changes
24
36
25
37
- change build pipeline to serve builds from both tsup, and tsc
26
38
39
+ ## 4.1.1-beta.0
40
+
41
+ ### Patch Changes
42
+
43
+ - fix plugin duplication due to missing seed provided to Elysia instances
44
+
27
45
## 4.1.0
28
46
29
47
### Minor Changes
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " elysia-rate-limit" ,
3
- "version" : " 4.2.0 " ,
3
+ "version" : " 4.2.1-beta.1 " ,
4
4
"description" : " Rate-limiter for Elysia.js" ,
5
5
"author" : {
6
6
"name" : " rayriffy" ,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const plugin = (userOptions?: Partial<Options>) => {
22
22
return ( app : Elysia ) => {
23
23
const plugin = new Elysia ( {
24
24
name : 'elysia-rate-limit' ,
25
+ seed : options . max ,
25
26
} )
26
27
27
28
plugin . onBeforeHandle (
@@ -71,6 +72,7 @@ export const plugin = (userOptions?: Partial<Options>) => {
71
72
)
72
73
73
74
const { count, nextReset } = await options . context . increment (
75
+ // biome-ignore lint/style/noNonNullAssertion: <explanation>
74
76
clientKey !
75
77
)
76
78
@@ -87,7 +89,7 @@ export const plugin = (userOptions?: Partial<Options>) => {
87
89
Math . ceil ( ( nextReset . getTime ( ) - Date . now ( ) ) / 1000 )
88
90
)
89
91
90
- let builtHeaders : Record < string , string > = {
92
+ const builtHeaders : Record < string , string > = {
91
93
'RateLimit-Limit' : String ( options . max ) ,
92
94
'RateLimit-Remaining' : String ( payload . remaining ) ,
93
95
'RateLimit-Reset' : String ( reset ) ,
You can’t perform that action at this time.
0 commit comments