UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

16 lines (12 loc) 305 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); async function attemptAsync(func) { try { const result = await func(); return [null, result]; } catch (error) { return [error, null]; } } exports.attemptAsync = attemptAsync;