UNPKG

koa2-ratelimit

Version:

IP rate-limiting middleware for Koajs 2. Use to limit repeated requests to APIs and/or endpoints such as password reset.

15 lines (11 loc) 296 B
const methods = ['incr', 'decrement', 'saveAbuse']; class Store { constructor() { for (const elem of methods) { if (this[elem] === undefined) { throw new TypeError(`Must override method ${elem}`); } } } } module.exports = Store;