source:
node_modules/es-toolkit/dist/promise/timeout.mjs@
ba17441
| Last change on this file since ba17441 was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 199 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | import { delay } from './delay.mjs'; |
| 2 | import { TimeoutError } from '../error/TimeoutError.mjs'; | |
| 3 | ||
| 4 | async function timeout(ms) { | |
| 5 | await delay(ms); | |
| 6 | throw new TimeoutError(); | |
| 7 | } | |
| 8 | ||
| 9 | export { timeout }; |
Note:
See TracBrowser
for help on using the repository browser.
