Add clampToMax
function
#370
aleclarson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One of the few Radashi functions that should handle undefined inputs. The main use case for this function is when working with a configurable quantity that has an upper bound. For example, a request handler that queries a database might accept a
limit
option that cannot exceed 100.Notably, when the
value
is undefined or ≤ 0, themax
value is used. This is a maintenance improvement over the following "native" approach:Alternative naming:
upperBound
Beta Was this translation helpful? Give feedback.
All reactions