source:
node_modules/es-toolkit/dist/util/attemptAsync.mjs
| Last change on this file was a762898, checked in by , 5 months ago | |
|---|---|
|
|
| File size: 204 bytes | |
| Rev | Line | |
|---|---|---|
| [a762898] | 1 | async function attemptAsync(func) { |
| 2 | try { | |
| 3 | const result = await func(); | |
| 4 | return [null, result]; | |
| 5 | } | |
| 6 | catch (error) { | |
| 7 | return [error, null]; | |
| 8 | } | |
| 9 | } | |
| 10 | ||
| 11 | export { attemptAsync }; |
Note:
See TracBrowser
for help on using the repository browser.
