init
This commit is contained in:
commit
d761a10bf7
102 changed files with 4761 additions and 0 deletions
10
lib/utils.ts
Normal file
10
lib/utils.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
export const getRandomInt = (min: number, max: number) => {
|
||||
min = Math.ceil(min);
|
||||
max = Math.floor(max);
|
||||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
};
|
||||
|
||||
export const clamp = (value: number, min: number, max: number) => {
|
||||
return Math.min(Math.max(value, min), max);
|
||||
};
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue