API reference
petty.rateLimit
petty.rateLimit.canFire
canFire(id: string): booleanTrue iff enough time has elapsed since the last fire(id) for the
cooldown declared under manifest.rateLimits[id]. Ids with no declared
cooldown always return true.
petty.rateLimit.fire
fire(id: string): voidRecords the current timestamp for future canFire checks.
petty.rateLimit.reset
reset(id: string): voidForgets the last-fired timestamp so the next canFire returns true.