gillchristian/io-ts-reporters

Change reporter to io-ts Reporter

gillchristian opened this issue · 0 comments

To follow io-ts "standard" for reporters we should update the reporter to match the Reporter interface

And also remove the default export in favor of the named one (reporter would be what is now prettyReporter)

/**
* Deprecated, use the default export instead.
*
* @category deprecated
* @deprecated
* @since 1.0.0
*/
export const reporter = <T>(validation: t.Validation<T>) =>
pipe(
validation,
E.mapLeft(formatValidationErrors),
E.fold(
errors => errors,
() => []
)
);
const prettyReporter: Reporter<string[]> = { report: reporter };
export default prettyReporter;

NOTE: this would be a breaking change