This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define the success/failure tuple types | |
| export type OperationSuccess<T> = readonly [data: T, error: null]; | |
| export type OperationFailure<E> = readonly [data: null, error: E]; | |
| export type OperationResult<T, E> = OperationSuccess<T> | OperationFailure<E>; | |
| // Define the allowed operation types | |
| /** | |
| * Checks if the value is a Promise or "Thenable" | |
| * @param value - The value to check | |
| * @returns True if the value is a Promise, false otherwise |