Skip to content

Commit 28098cb

Browse files
authoredMay 17, 2023
fix(types): don't require any properties if enabled is false (#595)
1 parent 1678135 commit 28098cb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/types.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ export type ThrottlingOptionsBase = {
3838
onRateLimit: LimitHandler;
3939
};
4040

41-
export type ThrottlingOptions = ThrottlingOptionsBase &
42-
(AbuseLimitHandler | SecondaryLimitHandler);
41+
export type ThrottlingOptions =
42+
| (ThrottlingOptionsBase & (AbuseLimitHandler | SecondaryLimitHandler))
43+
| (Partial<
44+
ThrottlingOptionsBase & (AbuseLimitHandler | SecondaryLimitHandler)
45+
> & { enabled: false });
4346

4447
export type Groups = {
4548
global?: Bottleneck.Group;

0 commit comments

Comments
 (0)
Please sign in to comment.