Resolve a numeric option like resolvePositiveInt, then clamp any result above max down to exactly max so upstream API limits are never exceeded.
max
The caller-supplied value (may be undefined).
undefined
The upper bound; larger values are reduced to this.
The default to use when value is not a usable positive integer.
value
A positive, finite integer no greater than max.
resolvePositiveInt
Resolve a numeric option like resolvePositiveInt, then clamp any result above
maxdown to exactlymaxso upstream API limits are never exceeded.