Functional Weave
Code in TypeScript

Tagged clamp

2 capabilities

math.clamp
Clamp an integer to an inclusive range, refusing a range whose bounds are the wrong way round.
clamp in TypeScript
money.compare
Compare two amounts of one currency, refusing to compare across currencies; min, max and clamp too.
A group of 4: compareMoney, minMoney, maxMoney, clampMoney