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
currently the generated functions just return a Boolean value. However in cases where ts-auto-guard is used for user feedback, a simple yes or no is not sufficient. A path to the faulty attributes would be better
@juliandm you can use debug mode to information about the first field that failed, however it is not intended for production.
This library is not a validation library, it generates type guards, which conventionally do not give more information other than is or is not a type.
That said when I first started working on this I did intend to create an option to generate validators, which is why it needs type-guard in the comment annotation (so that I could later add type-validator etc.) But if you're looking for runtime type validator you're better off using a library that explicitly has that as one of its goals.
I'll leave this issue open for now in case there's any more discussion.
currently the generated functions just return a Boolean value. However in cases where ts-auto-guard is used for user feedback, a simple yes or no is not sufficient. A path to the faulty attributes would be better
success response
faulty example, could be even more specific about, which type was expected etc..
The text was updated successfully, but these errors were encountered: