Created
May 13, 2024 12:25
-
-
Save woss/c9a67a632de0f622a63459966d1eebcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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