Setu-TS
    Preparing search index...

    Function deadlineRangeError

    • 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

      const refusal = deadlineRangeError('requestTimeoutMs', options.requestTimeoutMs);
      if (refusal !== null) throw refusal;

      0.9.0