mirror of
https://github.com/actions/container-toolkit-action.git
synced 2025-12-15 06:47:59 +00:00
Formatting and testing
This commit is contained in:
12
src/wait.ts
Normal file
12
src/wait.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Wait for a number of milliseconds. Resolves with 'done!' after the wait time.
|
||||
*/
|
||||
export async function wait(milliseconds: number): Promise<string> {
|
||||
return new Promise(resolve => {
|
||||
if (isNaN(milliseconds)) {
|
||||
throw new Error('milliseconds not a number')
|
||||
}
|
||||
|
||||
setTimeout(() => resolve('done!'), milliseconds)
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user