UNPKG

@piyawasin/attempt

Version:

A minimal, type-safe utility for defensive error handling in JS/TS. Inspired by Go, it uses tuple-based returns to eliminate try-catch nesting and handle synchronous/asynchronous errors predictably.

2 lines (1 loc) 75 B
export declare type AttemptResult<T, E = unknown> = [T, null] | [null, E];