This commit is contained in:
skidoodle 2024-03-13 00:30:45 +01:00
commit d761a10bf7
102 changed files with 4761 additions and 0 deletions

10
lib/utils.ts Normal file
View 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);
};