Restrict a numeric value to a specific inclusive range. If you are coming from Python, think of it like a max(min(val, high), low) one-liner, but with explicit type safety and clear bounds checking.
This implementation relies strictly on the TypeScript standard library. You get zero external dependencies and no backend services to configure.
clamp.ts
Check out the test suite located right next to the source file. It provides concrete usage patterns and edge cases to get you started.