Skip to content

Commit 9d1d224

Browse files
committed
lint errors fixed
1 parent 7687390 commit 9d1d224

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rateLimiters/slidingWindowCounter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)