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
Mostly for transition purposes for people who are familiar with check.
Hard requirement - it still needs to throw ValidationError errors, but I think this is achievable by using simple-schema under the hood.
The text was updated successfully, but these errors were encountered:
stubailo
changed the title
Add an option to validate arguments with check instead of SimpleSchema
Make a function that throws validation errors based on a check pattern
Dec 1, 2015
@aldeed is this easy to do with SimpleSchema? Can I somehow easily convert a check pattern into a SimpleSchema instance, and then get a validator function out of it?
SS does not use match patterns internally and I'm not aware of anyone having written a converter.
The simple option is a wrapper function that just catches the check error, smooshes it into a ValidationError, and rethrows it. This would not have field-specific errors I think.
Mostly for transition purposes for people who are familiar with check.
Hard requirement - it still needs to throw
ValidationError
errors, but I think this is achievable by using simple-schema under the hood.The text was updated successfully, but these errors were encountered: