fix lint errors

This commit is contained in:
syuilo
2021-11-12 10:52:10 +09:00
parent 84df0714d8
commit b9eaf906e7
22 changed files with 55 additions and 49 deletions

View File

@@ -10,16 +10,16 @@ const logger = new Logger('limiter');
export default (endpoint: IEndpoint, user: User) => new Promise<void>((ok, reject) => {
const limitation = endpoint.meta.limit!;
const key = limitation.hasOwnProperty('key')
const key = Object.prototype.hasOwnProperty.call(limitation, 'key')
? limitation.key
: endpoint.name;
const hasShortTermLimit =
limitation.hasOwnProperty('minInterval');
Object.prototype.hasOwnProperty.call(limitation, 'minInterval');
const hasLongTermLimit =
limitation.hasOwnProperty('duration') &&
limitation.hasOwnProperty('max');
Object.prototype.hasOwnProperty.call(limitation, 'duration') &&
Object.prototype.hasOwnProperty.call(limitation, 'max');
if (hasShortTermLimit) {
min();