Merge branch 'exponential-backoff' into sse-and-backoff
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
/**
|
||||
* 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;
|
||||
};
|
||||
|
||||
/**
|
||||
* Tries to execute an async function and handles any errors that occur.
|
||||
* @param fn - The function to execute.
|
||||
|
||||
Reference in New Issue
Block a user