Skip to content

fromResult

fromResult<E, A>(data): Validation<E, A>

Defined in: Core/Validation.ts:319

Converts a Result to a Validation. Ok becomes Passed; Err(e) becomes Failed([e]).

Useful when bridging from error-short-circuiting Result pipelines into error-accumulating Validation pipelines.

E

A

Result<E, A>

Validation<E, A>

Validation.fromResult(Result.ok(42));       // Passed(42)
Validation.fromResult(Result.err("bad"));   // Failed(["bad"])