UNPKG

es-toolkit

Version:

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

11 lines (9 loc) 151 B
function attempt(func) { try { return [null, func()]; } catch (error) { return [error, null]; } } export { attempt };