Skip to content

Commit

Permalink
fix: errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CahidArda committed Sep 17, 2024
1 parent 3a5df61 commit 9a68d25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ratelimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,6 @@ export abstract class Ratelimit<TContext extends Context> {
req?: Pick<LimitOptions, "ip" | "userAgent" | "country">
): string[] => {
const members = [identifier, req?.ip, req?.userAgent, req?.country];
return members.filter(Boolean)
return members.filter((item): item is string => Boolean(item));
}
}
1 change: 1 addition & 0 deletions src/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type { Duration } from "./duration";
import { ms } from "./duration";
import { safeEval } from "./hash";
import { RESET_SCRIPT, SCRIPTS } from "./lua-scripts/hash";
import { tokenBucketIdentifierNotFound } from "./lua-scripts/single";

import { Ratelimit } from "./ratelimit";
import type { Algorithm, RegionContext } from "./types";
Expand Down

0 comments on commit 9a68d25

Please sign in to comment.