mirror of
https://github.com/robonen/tools.git
synced 2026-03-20 19:04:46 +00:00
feat(packages/stdlib): math/clamp util
This commit is contained in:
3
packages/stdlib/src/math/clamp/index.ts
Normal file
3
packages/stdlib/src/math/clamp/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function clamp(value: number, min: number, max: number): number {
|
||||
return Math.min(Math.max(value, min), max);
|
||||
}
|
||||
Reference in New Issue
Block a user