Skip to content

toResult

toResult<E, A>(data): Result<E, A>

Defined in: Core/These.ts:279

Converts a These to a Result, discarding any warning from Both. Ok and Both produce Ok; Err produces Err.

E

A

These<E, A>

Result<E, A>

These.toResult(These.ok(42));           // Ok(42)
These.toResult(These.both("warn", 42)); // Ok(42)
These.toResult(These.err("err"));       // Err("err")