1
0
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:
2024-04-10 16:51:09 +07:00
parent 3f1d16b484
commit 8515bff983
4 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
export function clamp(value: number, min: number, max: number): number {
return Math.min(Math.max(value, min), max);
}