UNPKG

io-ts-extra

Version:

Adds pattern matching, optional properties, and several other helpers and types, to io-ts.

14 lines 781 B
import * as t from 'io-ts'; /** * Similar to io-ts's PathReporter, but gives slightly less verbose output. * @param validation Usually the result of calling `.decode` with an io-ts codec. * @param typeAlias io-ts type names can be verbose. If the type you're using doesn't have a name, * you can use this to keep error messages shorter. */ export declare const validationErrors: (validation: t.Validation<unknown>, typeAlias?: string | undefined) => string[]; /** * Either returns the `.right` of a io-ts `Validation`, or throws with a report of the validation error. * @see validationErrors */ export declare const getRightUnsafe: <T>(validation: import("fp-ts/lib/Either").Either<t.Errors, T>, typeAlias?: string | undefined) => T; //# sourceMappingURL=reporters.d.ts.map