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
I will update this later with a proper table, but some validators like isMobilePhone and isLicensePlate do not need a specified locale since the values are not dependent on the language used but only the country. For others, like isAlpha, we should remain using the locales. In any case country codes and locales should not be mixed (like in isIdentityCard)
What I have in mind is that we allow the countrycodes to be used first and that those are mapped to the current locales so both are supported but it's easy to remove the locales in a later major version. (I will provide an example in the updated issue)
My idea is that this is done after #1874 has been finished and we have split the test cases in different files. That makes it easier to see which tests are for the new syntax and which ones of the legacy syntax (see https://github.com/validatorjs/validator.js/blob/master/test/validators/isAfter.test.js for example). I would not recommend to do this in combination with other refactors (like #2124 ) so the scope of the refactors remain clear.
The text was updated successfully, but these errors were encountered:
a big +1 from my side for that!
I probably would say that #2171 should be done before tackling #2124, as it will be the "easier" task.
I also like the idea of at some point dropping some of the "mistakes" made in earlier version, where we currently need to work with workarounds to maintain backwards compatibility at all costs (but that is a separate topic from this proposal :-))
I will update this later with a proper table, but some validators like
isMobilePhone
andisLicensePlate
do not need a specified locale since the values are not dependent on the language used but only the country. For others, likeisAlpha
, we should remain using the locales. In any case country codes and locales should not be mixed (like inisIdentityCard
)What I have in mind is that we allow the countrycodes to be used first and that those are mapped to the current locales so both are supported but it's easy to remove the locales in a later major version. (I will provide an example in the updated issue)
My idea is that this is done after #1874 has been finished and we have split the test cases in different files. That makes it easier to see which tests are for the new syntax and which ones of the legacy syntax (see https://github.com/validatorjs/validator.js/blob/master/test/validators/isAfter.test.js for example). I would not recommend to do this in combination with other refactors (like #2124 ) so the scope of the refactors remain clear.
The text was updated successfully, but these errors were encountered: