export function Ok(value) {
    return {
        value,
        unwrap: () => value,
        isErr: () => false,
        isOk: () => true,
        map: (fn) => {
            try {
                return Ok(fn(value));
            }
            catch (error) {
                return Err(error);
            }
        }
    };
}
export function Err(error) {
    return {
        error: error instanceof Error ? error : new Error(error),
        unwrap: () => {
            throw error;
        },
        isErr: () => true,
        isOk: () => false,
        map: (_fn) => {
            return Err(error);
        }
    };
}
//# sourceMappingURL=result.js.map