arb / celebrate

A joi validation middleware for Express.
MIT License
1.33k stars 66 forks source link

Make `isCelebrateError` a static method on the object #199

Closed arb closed 3 years ago

StephanGeorg commented 3 years ago

When was isCelebrate removed from code? Even in the docs it's still referenced:

If the error response format does not suite your needs, you are encouraged to write your own and check isCelebrate(err) to format celebrate errors to your liking.

isCelebrateError does not work to check if a custom error is a celebrate error.

arb commented 3 years ago

That's a good point, attaching it to CelebrateError makes it essentially useless 🤦‍♂️ isCelebrate was renamed in version 13. It still being mentioned in the docs is an oversight. Whoops!