mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
parent
2575d45f0b
commit
0ec019f959
16 changed files with 209 additions and 34 deletions
|
|
@ -21,3 +21,8 @@ export async function parseForm(request: Request) {
|
|||
const data = JSON.parse(dataInput)
|
||||
return { ...data, ...rest }
|
||||
}
|
||||
|
||||
export function getRandom<T>(array: T[]): T {
|
||||
const randomIndex = Math.floor(Math.random() * array.length)
|
||||
return array[randomIndex]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue