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.