source: node_modules/es-toolkit/dist/compat/function/attempt.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 179 bytes
Line 
1function attempt(func, ...args) {
2 try {
3 return func(...args);
4 }
5 catch (e) {
6 return e instanceof Error ? e : new Error(e);
7 }
8}
9
10export { attempt };
Note: See TracBrowser for help on using the repository browser.