Validator.js: validator for country names?

Created on 5 Dec 2019  路  5Comments  路  Source: validatorjs/validator.js

how about adding a validator for checking countryname. If allowed, i can submit a pr in about tonight

to-be-closed 馃嵖 discussion

Most helpful comment

Bearing in mind the possible inconsistencies in accurately writing country names, this would be difficult to maintain and it is better off limiting user choices using selection lists in the application.

All 5 comments

@ezkemboi @profnandaa

I'm always seated right in the middle of the fence when it comes to this class of feature requests. I was once very dogmatic about having only _regex-related_ features in the library but my stand has been challenged, see #977 . For this, I will chose not to place my vote but wait for others to say what they think.

I am also in the middle here.
Though, it might be a good feature in addition to the locale feature.

@profnandaa I agree, and country names are not "fixed" anyway. It would just increase the maintenance/technical/download debt.. do you really want to be collating and keeping up to date with external lists? Also why a country names validator? Anyone that needs country names has a list.. so validate against their own list?

Do I really want a simple validation library that includes complete data of specific types I may not use?

A possible solution is telling people that you can validate these things yourself on your own terms.
i.e. https://github.com/validatorjs/validator.js/pull/1248

Bearing in mind the possible inconsistencies in accurately writing country names, this would be difficult to maintain and it is better off limiting user choices using selection lists in the application.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MindRapist picture MindRapist  路  4Comments

rathboma picture rathboma  路  4Comments

Maxreglez picture Maxreglez  路  3Comments

AtomicBorg picture AtomicBorg  路  3Comments

smohiuddin picture smohiuddin  路  4Comments