ianstormtaylor / superstruct

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

Document custom error messages for refinements #1113

Closed arturmuller closed 1 year ago

arturmuller commented 1 year ago

As per https://github.com/ianstormtaylor/superstruct/issues/1095.

Note that I also added a short "robot tip" about the typing of refiner function's value, as I felt it might be reassuring to know that value.startDate < value.endDate is guaranteed to be safe.

ianstormtaylor commented 1 year ago

Thank you @arturmuller, this is awesome!