/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

/**
 * Constrains a value to be within a specified range.
 *
 * @param min - The lower bound of the range
 * @param max - The upper bound of the range
 * @param value - The value to constrain
 * @returns The constrained value
 */
export function clamp( min, max, value ) {
	return Math.min( Math.max( min, value ), max );
}
