gcanti / tcomb-validation

Validation library based on type combinators
MIT License
400 stars 23 forks source link

ValidationError: relax message type (from String to Any) #54

Closed pigoz closed 7 years ago

pigoz commented 7 years ago

In some applications the user may want to separate validation logic from error generation and i18n. This allows to to return any kind of data as message so that the UI can use it to do further processing.

This code could look a little unclean. A better solution that doesn't break backwards compatibility would be to add a new API similar to getValidationErrorMessage, but that would require a lot of work and code complexity for a not very important use case.

Fixes: #53

gcanti commented 7 years ago

Thx!

gcanti commented 7 years ago

Released in https://github.com/gcanti/tcomb-validation/releases/tag/v3.3.0