You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The instanceof operator doesn't always work when there are multiple versions of toi in one monorepo, for example. Different require statements result in multiple ValidationError classes and the check that is performed with instanceof is no longer reliable.
One approach on how can this be fixed is by introducing a boolen flag, like isToi, to the ValidationError class that will identify the error. The Joi library has the same approach.
The text was updated successfully, but these errors were encountered:
The
instanceof
operator doesn't always work when there are multiple versions oftoi
in one monorepo, for example. Differentrequire
statements result in multipleValidationError
classes and the check that is performed withinstanceof
is no longer reliable.One approach on how can this be fixed is by introducing a boolen flag, like
isToi
, to theValidationError
class that will identify the error. TheJoi
library has the same approach.The text was updated successfully, but these errors were encountered: