Convert to ESM

This commit is contained in:
Nick Alteen
2025-01-08 11:58:58 -05:00
parent f78d56ba70
commit 844440f60c
40 changed files with 33184 additions and 37099 deletions

View File

@@ -1,11 +1,12 @@
/**
* Wait for a number of milliseconds. Resolves with 'done!' after the wait time.
* Waits for a number of milliseconds.
*
* @param milliseconds The number of milliseconds to wait.
* @returns Resolves with 'done!' after the wait is over.
*/
export async function wait(milliseconds: number): Promise<string> {
return new Promise(resolve => {
if (isNaN(milliseconds)) {
throw new Error('milliseconds not a number')
}
return new Promise((resolve) => {
if (isNaN(milliseconds)) throw new Error('milliseconds is not a number')
setTimeout(() => resolve('done!'), milliseconds)
})