Skip to content

Commit

Permalink
docs: remove hardcoded postal code list from JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
NoNameProvided committed Nov 20, 2022
1 parent 5b0b962 commit cf8d2c0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/decorator/string/IsPostalCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ import ValidatorJS from 'validator';
export const IS_POSTAL_CODE = 'isPostalCode';

/**
* Check if the string is a postal code,
* (locale is one of [ 'AD', 'AT', 'AU', 'BE', 'BG', 'BR', 'CA', 'CH', 'CZ', 'DE', 'DK', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'ID', 'IE' 'IL', 'IN', 'IR', 'IS', 'IT', 'JP', 'KE', 'LI', 'LT', 'LU', 'LV', 'MT', 'MX', 'NL', 'NO', 'NZ', 'PL', 'PR', 'PT', 'RO', 'RU', 'SA', 'SE', 'SI', 'TN', 'TW', 'UA', 'US', 'ZA', 'ZM' ] OR 'any'. If 'any' is used, function will check if any of the locals match. Locale list is validator.isPostalCodeLocales.).
* Check if the string is a postal code, in the specified locale.
* If given value is not a string, then it returns false.
*/
export function isPostalCode(value: unknown, locale: 'any' | ValidatorJS.PostalCodeLocale): boolean {
return typeof value === 'string' && isPostalCodeValidator(value, locale);
}

/**
* Check if the string is a postal code,
* (locale is one of [ 'AD', 'AT', 'AU', 'BE', 'BG', 'BR', 'CA', 'CH', 'CZ', 'DE', 'DK', 'DZ', 'EE', 'ES', 'FI', 'FR', 'GB', 'GR', 'HR', 'HU', 'ID', 'IE' 'IL', 'IN', 'IR', 'IS', 'IT', 'JP', 'KE', 'LI', 'LT', 'LU', 'LV', 'MT', 'MX', 'NL', 'NO', 'NZ', 'PL', 'PR', 'PT', 'RO', 'RU', 'SA', 'SE', 'SI', 'TN', 'TW', 'UA', 'US', 'ZA', 'ZM' ] OR 'any'. If 'any' is used, function will check if any of the locals match. Locale list is validator.isPostalCodeLocales.).
* Check if the string is a postal code, in the specified locale.
* If given value is not a string, then it returns false.
*/
export function IsPostalCode(
Expand Down

0 comments on commit cf8d2c0

Please sign in to comment.