Skip to content

Instantly share code, notes, and snippets.

@woss
Created May 13, 2024 12:25
Show Gist options
  • Save woss/c9a67a632de0f622a63459966d1eebcb to your computer and use it in GitHub Desktop.
Save woss/c9a67a632de0f622a63459966d1eebcb to your computer and use it in GitHub Desktop.
/**
* Return a function that checks if a number is in a range
* @param low - inclusive
* @param high - inclusive
* @returns
*/
export function inRange(low: number, high: number): (x: number) => boolean {
return allPass([(x: number) => x >= low, (x: number) => x <= high]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment