five-on-it / apps/api/src/rate-limits / WindowCount
Interface: WindowCount
Defined in: apps/api/src/rate-limits.ts:16
Uses counted a window per key, looked at apart from counting: what a key may still do, and one more done.
Methods
allows()
allows(
key):boolean
Defined in: apps/api/src/rate-limits.ts:18
Whether key has used fewer than its limit in its window.
Parameters
key
string
Returns
boolean
count()
count(
key):void
Defined in: apps/api/src/rate-limits.ts:20
Counts one use for key.
Parameters
key
string
Returns
void