Checks a deadline value, returning the refusal or null when it is valid.
Exported so an option holder can refuse a bad value at CONSTRUCTION with the
same rule withDeadline applies at call time, instead of the
first call discovering it.
Parameters
name: string
The option name, used in the refusal message
timeoutMs: number
The value to check
Returns RangeError|null
A RangeError naming the option, or null when the value is valid
Example
constrefusal = deadlineRangeError('requestTimeoutMs', options.requestTimeoutMs); if (refusal !== null) throwrefusal;
Checks a deadline value, returning the refusal or
nullwhen it is valid.Exported so an option holder can refuse a bad value at CONSTRUCTION with the same rule
withDeadlineapplies at call time, instead of the first call discovering it.