AniLink - v3.1.0
    Preparing search index...

    Function resolveCappedInt

    • Resolve a numeric option like resolvePositiveInt, then clamp any result above max down to exactly max so upstream API limits are never exceeded. Values above the cap are clamped (not thrown) because exceeding a provider-documented cap is a legitimate tuning attempt, not a bug.

      Parameters

      • value: number | undefined

        The caller-supplied value (may be undefined).

      • max: number

        The upper bound; larger values are reduced to this.

      • fallback: number

        The default to use when value is undefined.

      • name: string = "option"

        The option name used in the error message.

      Returns number

      A positive, finite integer no greater than max.

      A TypeError when value is defined but not a finite, positive number.