ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).
https://docs.superstructjs.org
MIT License
7.02k stars 224 forks source link

Add custom error messages (#568) #1141

Closed Azarattum closed 1 year ago

Azarattum commented 1 year ago

While not completely covers #568, it allows for custom error messages at the assertion level as discussed in https://github.com/ianstormtaylor/superstruct/issues/568#issuecomment-1313195000. This PR contains the feature itself, as well as updated docs and tests in separate commits.

ianstormtaylor commented 1 year ago

Absolutely beautiful PR, thank you @Azarattum!