UNPKG

@atlaskit/tokens

Version:

Design tokens are the single source of truth to name and store design decisions.

14 lines 296 B
/** * Clamps an integer between two floating-point numbers. * * @return input when min <= input <= max, and either min or max * otherwise. */ export function clampDouble(min, max, input) { if (input < min) { return min; } else if (input > max) { return max; } return input; }