Improve validation code. Add throws tsdocs to validateOptions

This commit is contained in:
2026-08-06 10:06:04 +00:00
parent 5e8b0a1ea8
commit 604cd36334
2 changed files with 46 additions and 29 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* 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;
};