File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ class SlidingWindowCounter implements RateLimiter {
105105
106106 const window : RedisWindow = await JSON . parse ( windowJSON ) ;
107107
108- let updatedUserWindow : RedisWindow = {
108+ const updatedUserWindow : RedisWindow = {
109109 currentTokens : window . currentTokens ,
110110 previousTokens : window . previousTokens ,
111111 fixedWindowStart : window . fixedWindowStart ,
@@ -120,7 +120,7 @@ class SlidingWindowCounter implements RateLimiter {
120120
121121 // assigned to avoid TS error, this var will never be used as 0
122122 // var is declared here so that below can be inside a conditional for efficiency's sake
123- let rollingWindowProportion : number = 0 ;
123+ let rollingWindowProportion = 0 ;
124124
125125 if ( updatedUserWindow . previousTokens ) {
126126 // subtract window size by current time less fixed window's start
@@ -133,7 +133,7 @@ class SlidingWindowCounter implements RateLimiter {
133133 this . windowSize ;
134134
135135 // remove unecessary decimals, 0.xx is enough
136- rollingWindowProportion = rollingWindowProportion - ( rollingWindowProportion % 0.01 ) ;
136+ rollingWindowProportion - = rollingWindowProportion % 0.01 ;
137137 }
138138
139139 // the sliding window counter formula
You can’t perform that action at this time.
0 commit comments