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
Is this a supported feature, but my usage is wrong? Or is that currently not supported?
Use-case: Validating user-defined options when users are allowed to specify their own keys (arbitrary / unknown during buildtime), but the value must meet a certain format
constvalidate=newValidator({yourFriendsNamesAndAges: {fred: 'invalid-must-be-a-number',simon: 55}},{'yourFriendsNamesAndAges.*': 'number'})console.log(validate.errors.first())// false .... would expect true, for 'fred'?
Thanks for your help 👋
The text was updated successfully, but these errors were encountered:
JaiPe
changed the title
Wildcard object validation
Wildcard object validation supported?
Nov 7, 2021
Hi there.
Using v3.22.1 and it seems we can't validate the values of unknown object keys? e.g.
Input:
Validator:
Is this a supported feature, but my usage is wrong? Or is that currently not supported?
Use-case: Validating user-defined options when users are allowed to specify their own keys (arbitrary / unknown during buildtime), but the value must meet a certain format
Thanks for your help 👋
The text was updated successfully, but these errors were encountered: