Skip to content

Commit

Permalink
refactor: removed underscore prefix for used variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Waidmann authored and jmcdo29 committed Jun 14, 2024
1 parent 16467c1 commit 53b965d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/throttler.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class ThrottlerGuard implements CanActivate {
ThrottlerOptions,
'skipIf' | 'ignoreUserAgents' | 'getTracker' | 'generateKey'
>;

constructor(
@InjectThrottlerOptions() protected readonly options: ThrottlerModuleOptions,
@InjectThrottlerStorage() protected readonly storageService: ThrottlerStorage,
Expand Down Expand Up @@ -220,14 +221,14 @@ export class ThrottlerGuard implements CanActivate {
}

protected async getErrorMessage(
_context: ExecutionContext,
_throttlerLimitDetail: ThrottlerLimitDetail,
context: ExecutionContext,
throttlerLimitDetail: ThrottlerLimitDetail,
): Promise<string> {
if (!Array.isArray(this.options)) {
if (!this.options.errorMessage) return this.errorMessage;

return typeof this.options.errorMessage === 'function'
? this.options.errorMessage(_context, _throttlerLimitDetail)
? this.options.errorMessage(context, throttlerLimitDetail)
: this.options.errorMessage;
}
return this.errorMessage;
Expand Down

0 comments on commit 53b965d

Please sign in to comment.