16 lines
455 B
TypeScript
16 lines
455 B
TypeScript
/**
|
|
* Validate the value is within the bounds, returning true if it is within the bounds, false otherwise
|
|
*
|
|
* @param value - The value to validate
|
|
* @param min - The minimum value
|
|
* @param max - The maximum value
|
|
*
|
|
* @returns True if the value is within the bounds, false otherwise
|
|
*/
|
|
export const isWithinBounds = (value: number, min: number, max: number): boolean => {
|
|
if (value < min || value > max) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}; |