chore: rename range to clamp (#8903)

* chore: rename range to clamp

* chore: merge upstream
This commit is contained in:
neverland
2021-06-21 16:20:03 +08:00
committed by GitHub
parent 8fb8055243
commit e0bfb44d3c
8 changed files with 34 additions and 35 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
export function range(num: number, min: number, max: number): number {
/** clamps number within the inclusive lower and upper bounds */
export function clamp(num: number, min: number, max: number): number {
return Math.min(Math.max(num, min), max);
}