Skip to content

match

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

Defined in: Core/Validation.ts:182

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

E

A

B

(errors) => B

(a) => B

(data): B

Validation<E, A>

B

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