{"action":"created","issue":{"url":"https://api.github.com/repos/chriso/validator.js/issues/815","repository_url":"https://api.github.com/repos/chriso/validator.js","labels_url":"https://api.github.com/repos/chriso/validator.js/issues/815/labels{/name}","comments_url":"https://api.github.com/repos/chriso/validator.js/issues/815/comments","events_url":"https://api.github.com/repos/chriso/validator.js/issues/815/events","html_url":"https://github.com/chriso/validator.js/issues/815","id":314303542,"node_id":"MDU6SXNzdWUzMTQzMDM1NDI=","number":815,"title":"Export the list of supported countries for isPostalCode, locales for isMobilePhone, etc...","user":{"login":"dantman","id":53399,"node_id":"MDQ6VXNlcjUzMzk5","avatar_url":"https://avatars2.githubusercontent.com/u/53399?v=4","gravatar_id":"","url":"https://api.github.com/users/dantman","html_url":"https://github.com/dantman","followers_url":"https://api.github.com/users/dantman/followers","following_url":"https://api.github.com/users/dantman/following{/other_user}","gists_url":"https://api.github.com/users/dantman/gists{/gist_id}","starred_url":"https://api.github.com/users/dantman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantman/subscriptions","organizations_url":"https://api.github.com/users/dantman/orgs","repos_url":"https://api.github.com/users/dantman/repos","events_url":"https://api.github.com/users/dantman/events{/privacy}","received_events_url":"https://api.github.com/users/dantman/received_events","type":"User","site_admin":false},"labels":[{"id":440325383,"node_id":"MDU6TGFiZWw0NDAzMjUzODM=","url":"https://api.github.com/repos/chriso/validator.js/labels/feature-request","name":"feature-request","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-14T06:18:52Z","updated_at":"2018-09-01T20:17:02Z","closed_at":null,"author_association":"NONE","body":"I would like to use `isPostalCode` for form validation in a situation where the country code may be input by the user. I want to validate all the common countries (Canada, US, UK, etc...) that validator supports but if validator doesn't know how to validate a country's postal code I just want to consider all input valid.\r\n\r\nThe problem is that `isPostalCode` will throw a generic Error instance if the country code is one it does not understand. Which I cannot differentiate from a programming error without checking against the `message` (bad practice). The only thing I can do at the moment is hardcode a list of what countries are supported by `isPostalCode` in my code and check against that list before calling it to determine if it's safe to call. However this leaves open the possibility that validator will add support for another country's postal codes (I even found [a database](http://www.mapanet.eu/EN/resources/Postal-Format.asp) that seems to have more than what is in validator that validator might want to source some info from), which will make my list be out of date.\r\n\r\nIt would be nice if the list of countries supported by `isPostalCode` would be exported somewhere so I could import it and check my user inputted country codes so see if the postal code is safe to validate.\r\n\r\nIt would also work to add an option to consider postal codes from all unknown countries as valid. However I am also considering the possibility of doing something like `required={isRequired && canValidatePostalCodeForCountry(countryCode)}` to disable postal codes being required in forms when it's not known if the country has them."},"comment":{"url":"https://api.github.com/repos/chriso/validator.js/issues/comments/417884512","html_url":"https://github.com/chriso/validator.js/issues/815#issuecomment-417884512","issue_url":"https://api.github.com/repos/chriso/validator.js/issues/815","id":417884512,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzg4NDUxMg==","user":{"login":"chriso","id":364903,"node_id":"MDQ6VXNlcjM2NDkwMw==","avatar_url":"https://avatars3.githubusercontent.com/u/364903?v=4","gravatar_id":"","url":"https://api.github.com/users/chriso","html_url":"https://github.com/chriso","followers_url":"https://api.github.com/users/chriso/followers","following_url":"https://api.github.com/users/chriso/following{/other_user}","gists_url":"https://api.github.com/users/chriso/gists{/gist_id}","starred_url":"https://api.github.com/users/chriso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriso/subscriptions","organizations_url":"https://api.github.com/users/chriso/orgs","repos_url":"https://api.github.com/users/chriso/repos","events_url":"https://api.github.com/users/chriso/events{/privacy}","received_events_url":"https://api.github.com/users/chriso/received_events","type":"User","site_admin":false},"created_at":"2018-09-01T20:17:02Z","updated_at":"2018-09-01T20:17:02Z","author_association":"OWNER","body":"@ProfNandaa I don't think the list of mobile phone locales is being exported currently."}}
{"actor":{"display_login":"chriso"}}