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
If you define a before(value) => newValue callback for a property, the transformed input is not the one that is going to be validated. The validation will occur against the original input.
Shouldn't the validation function be passed the transformed input instead?
My use case is that I'm asking for a version string, which will ultimately be validated against a Semantic Version pattern, but I want to be flexible enough to allow the user to input simple versions (i.e. 1 or 1.1). My before() transformation function handles such cases (and only such cases) and transforms the input into valid semver values (i.e. 1.0.0 and 1.1.0). Any other value is returned as-is by the transformation function to be validated against pattern. #
The text was updated successfully, but these errors were encountered:
If you define a
before(value) => newValue
callback for a property, the transformed input is not the one that is going to be validated. The validation will occur against the original input.Shouldn't the validation function be passed the transformed input instead?
My use case is that I'm asking for a version string, which will ultimately be validated against a Semantic Version pattern, but I want to be flexible enough to allow the user to input simple versions (i.e. 1 or 1.1). My
before()
transformation function handles such cases (and only such cases) and transforms the input into valid semver values (i.e. 1.0.0 and 1.1.0). Any other value is returned as-is by the transformation function to be validated againstpattern
. #The text was updated successfully, but these errors were encountered: