跳转到内容
简体中文

RateLimitOptionsValidator

此内容尚不支持你的语言。

Defined in: src/http/cache/RateLimitOptions.ts:92

Validates resolved RateLimitOptionsType settings: the rolling window (windowMs) must be a positive finite number of milliseconds and the per-window cap (max) a positive integer. (Presence of cache / key is a required-field concern, not a domain-validity one.)

new RateLimitOptionsValidator(): RateLimitOptionsValidator

Defined in: src/http/cache/RateLimitOptions.ts:93

RateLimitOptionsValidator

OptionsValidator<RateLimitOptionsType>.constructor

validate(settings): void

Defined in: src/util/OptionsValidator.ts:75

Check the (merged) settings; throws OptionsError on the first violation. Unset (undefined) fields always pass.

Partial<T>

void

OptionsValidator.validate