createLimiterfunction
import { createLimiter } from '@mortar-kit/auth'
function createLimiter(max: number, windowMs: number, now?: () => number): (key: string) => numberA fixed-window counter per key: returns 0 while the key is under max
hits in the current window, else the milliseconds until it resets.
Expired windows are swept as it goes, so memory stays bounded by the
clients seen in one window.
Parameters
max: numberwindowMs: numbernow?: () => number
Returns
(key: string) => number