Skip to content

Change reporter to io-ts Reporter #36

@gillchristian

Description

@gillchristian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions