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