hapijs / joi

The most powerful data validation library for JS
Other
20.94k stars 1.51k forks source link

fix: LanguageMessages type now supports languages in TypeScript #3009

Closed jacobkapitein closed 10 months ago

jacobkapitein commented 10 months ago

Closes:

This feature has always really been supported, but the type was correct all the time, resulting in build errors. Only fixable with ugly ts-expect-error patterns or ts-patch files. It was really annoying to see this feature actually documented, but the type not being correct.

Multiple tests are already present, but this is one example: https://github.com/hapijs/joi/blob/master/test/errors.js#L176-L196

Code that backs this up as being an existing and supported feature: https://github.com/hapijs/joi/blob/master/lib/errors.js#L133-L143

Would love to hear back!

Marsup commented 10 months ago

Thanks for the PR. The CI has nothing to do with you, I'll merge as is.