Skip to content

match

match<E, A, B>(cases): (data) => B

Defined in: Core/Validation.ts:204

Pattern matches on a Validation, returning the result of the matching case.

E

A

B

(errors) => B

(a) => B

(data) => B

pipe(
  validation,
  Validation.match({
    passed: value => `Got ${value}`,
    failed: errors => `Failed: ${errors.join(", ")}`
  })
);