PATH:
opt
/
bitninja-dispatcher
/
node_modules
/
class-validator
/
esm2015
/
decorator
/
string
{"version":3,"file":"IsPostalCode.js","sourceRoot":"","sources":["../../../../src/decorator/string/IsPostalCode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,qBAAqB,MAAM,4BAA4B,CAAC;AAG/D,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;AAE7C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,MAA4C;IACvF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,qBAAqB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,MAA6C,EAC7C,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;YAC5E,cAAc,EAAE,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,GAAG,iCAAiC,EAAE,iBAAiB,CAAC;SAC9G;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\nimport isPostalCodeValidator from 'validator/lib/isPostalCode';\nimport ValidatorJS from 'validator';\n\nexport const IS_POSTAL_CODE = 'isPostalCode';\n\n/**\n * Check if the string is a postal code,\n * (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.).\n * If given value is not a string, then it returns false.\n */\nexport function isPostalCode(value: unknown, locale: 'any' | ValidatorJS.PostalCodeLocale): boolean {\n return typeof value === 'string' && isPostalCodeValidator(value, locale);\n}\n\n/**\n * Check if the string is a postal code,\n * (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.).\n * If given value is not a string, then it returns false.\n */\nexport function IsPostalCode(\n locale?: 'any' | ValidatorJS.PostalCodeLocale,\n validationOptions?: ValidationOptions\n): PropertyDecorator {\n return ValidateBy(\n {\n name: IS_POSTAL_CODE,\n constraints: [locale],\n validator: {\n validate: (value, args): boolean => isPostalCode(value, args.constraints[0]),\n defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be a postal code', validationOptions),\n },\n },\n validationOptions\n );\n}\n"]}
[-] IsDecimal.js
[edit]
[-] IsFirebasePushId.js.map
[edit]
[-] IsByteLength.js
[edit]
[-] IsISBN.js.map
[edit]
[-] IsLowercase.js
[edit]
[-] IsUrl.js
[edit]
[-] IsDataURI.js.map
[edit]
[-] IsISIN.js.map
[edit]
[-] IsPort.js.map
[edit]
[-] IsLowercase.js.map
[edit]
[-] IsJSON.js
[edit]
[-] IsFQDN.js.map
[edit]
[-] IsLocale.js.map
[edit]
[-] IsDateString.js
[edit]
[-] IsBooleanString.js
[edit]
[-] IsUppercase.js
[edit]
[-] IsUppercase.js.map
[edit]
[-] IsCreditCard.js
[edit]
[-] IsIBAN.js.map
[edit]
[-] IsLocale.js
[edit]
[-] IsMilitaryTime.js
[edit]
[-] IsAlphanumeric.js
[edit]
[-] IsHexColor.js
[edit]
[-] Contains.js.map
[edit]
[-] IsHalfWidth.js
[edit]
[-] IsHSL.js
[edit]
[-] IsNumberString.js.map
[edit]
[-] IsNumberString.js
[edit]
[-] IsPhoneNumber.js
[edit]
[+]
..
[-] IsMacAddress.js
[edit]
[-] IsCurrency.js
[edit]
[-] IsBtcAddress.js
[edit]
[-] IsBIC.js.map
[edit]
[-] IsUrl.js.map
[edit]
[-] IsISRC.js
[edit]
[-] IsUUID.js
[edit]
[-] IsPort.js
[edit]
[-] IsRFC3339.js
[edit]
[-] IsSemVer.js.map
[edit]
[-] IsAscii.js.map
[edit]
[-] Length.js.map
[edit]
[-] IsISO8601.js.map
[edit]
[-] IsISO31661Alpha3.js
[edit]
[-] IsSurrogatePair.js.map
[edit]
[-] IsIBAN.js
[edit]
[-] IsAscii.js
[edit]
[-] IsOctal.js.map
[edit]
[-] IsFullWidth.js
[edit]
[-] IsCurrency.js.map
[edit]
[-] MaxLength.js
[edit]
[-] IsFirebasePushId.js
[edit]
[-] IsHash.js
[edit]
[-] IsAlphanumeric.js.map
[edit]
[-] IsBase64.js.map
[edit]
[-] IsCreditCard.js.map
[edit]
[-] IsRgbColor.js
[edit]
[-] MinLength.js.map
[edit]
[-] IsISSN.js
[edit]
[-] IsPassportNumber.js
[edit]
[-] IsFQDN.js
[edit]
[-] IsVariableWidth.js.map
[edit]
[-] IsMimeType.js
[edit]
[-] IsJWT.js.map
[edit]
[-] IsPassportNumber.js.map
[edit]
[-] IsBooleanString.js.map
[edit]
[-] IsPostalCode.js.map
[edit]
[-] IsISO31661Alpha2.js.map
[edit]
[-] IsMagnetURI.js.map
[edit]
[-] IsISO31661Alpha3.js.map
[edit]
[-] IsSurrogatePair.js
[edit]
[-] IsRgbColor.js.map
[edit]
[-] Length.js
[edit]
[-] IsBase64.js
[edit]
[-] IsDataURI.js
[edit]
[-] IsVariableWidth.js
[edit]
[-] IsByteLength.js.map
[edit]
[-] IsISO8601.js
[edit]
[-] MinLength.js
[edit]
[-] Contains.js
[edit]
[-] IsEAN.js
[edit]
[-] IsHalfWidth.js.map
[edit]
[-] IsDateString.js.map
[edit]
[-] IsIP.js.map
[edit]
[-] IsEthereumAddress.js
[edit]
[-] NotContains.js
[edit]
[-] IsIdentityCard.js
[edit]
[-] IsEmail.js.map
[edit]
[-] IsAlpha.js
[edit]
[-] IsAlpha.js.map
[edit]
[-] IsEAN.js.map
[edit]
[-] IsHash.js.map
[edit]
[-] IsBase32.js.map
[edit]
[-] Matches.js.map
[edit]
[-] IsIP.js
[edit]
[-] MaxLength.js.map
[edit]
[-] IsMacAddress.js.map
[edit]
[-] IsUUID.js.map
[edit]
[-] IsBase32.js
[edit]
[-] IsISO31661Alpha2.js
[edit]
[-] IsEthereumAddress.js.map
[edit]
[-] IsISRC.js.map
[edit]
[-] IsDecimal.js.map
[edit]
[-] IsJSON.js.map
[edit]
[-] IsBtcAddress.js.map
[edit]
[-] IsISSN.js.map
[edit]
[-] IsHexadecimal.js.map
[edit]
[-] IsISBN.js
[edit]
[-] IsHexadecimal.js
[edit]
[-] IsOctal.js
[edit]
[-] IsMultibyte.js
[edit]
[-] IsBIC.js
[edit]
[-] IsHSL.js.map
[edit]
[-] NotContains.js.map
[edit]
[-] IsFullWidth.js.map
[edit]
[-] IsHexColor.js.map
[edit]
[-] IsMobilePhone.js
[edit]
[-] IsEmail.js
[edit]
[-] IsISIN.js
[edit]
[-] IsMongoId.js.map
[edit]
[-] IsMilitaryTime.js.map
[edit]
[-] IsMultibyte.js.map
[edit]
[-] IsPhoneNumber.js.map
[edit]
[-] IsSemVer.js
[edit]
[-] IsRFC3339.js.map
[edit]
[-] IsMobilePhone.js.map
[edit]
[-] Matches.js
[edit]
[-] IsJWT.js
[edit]
[-] IsPostalCode.js
[edit]
[-] IsIdentityCard.js.map
[edit]
[-] IsMongoId.js
[edit]
[-] IsMagnetURI.js
[edit]
[-] IsMimeType.js.map
[edit]