3
common/resources/client/utils/number/clamp.ts
Executable file
3
common/resources/client/utils/number/clamp.ts
Executable file
@@ -0,0 +1,3 @@
|
||||
export function clamp(num: number, min: number, max: number) {
|
||||
return Math.min(Math.max(num, min), max);
|
||||
}
|
||||
3
common/resources/client/utils/number/is-number.ts
Executable file
3
common/resources/client/utils/number/is-number.ts
Executable file
@@ -0,0 +1,3 @@
|
||||
export function isNumber(value: any): value is number {
|
||||
return typeof value === 'number' && !Number.isNaN(value);
|
||||
}
|
||||
Reference in New Issue
Block a user