HEX
Server: LiteSpeed
System: Linux spg20.cloudpowerdns.com 5.14.0-611.35.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 25 03:46:09 EST 2026 x86_64
User: carrerup (3153)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //opt/bitninja-dispatcher/node_modules/class-validator/esm5/decorator/string/IsPhoneNumber.js.map
{"version":3,"file":"IsPhoneNumber.js","sourceRoot":"","sources":["../../../../src/decorator/string/IsPhoneNumber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAe,MAAM,mBAAmB,CAAC;AAE5E,MAAM,CAAC,IAAM,eAAe,GAAG,eAAe,CAAC;AAE/C;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,MAAoB;IAC/D,IAAI;QACF,IAAM,QAAQ,GAAG,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC3D,IAAM,MAAM,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,EAAE,CAAC;QACnC,OAAO,CAAC,CAAC,MAAM,CAAC;KACjB;IAAC,OAAO,KAAK,EAAE;QACd,WAAW;QACX,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAAoB,EAAE,iBAAqC;IACvF,OAAO,UAAU,CACf;QACE,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,SAAS,EAAE;YACT,QAAQ,EAAE,UAAC,KAAK,EAAE,IAAI,IAAc,OAAA,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAzC,CAAyC;YAC7E,cAAc,EAAE,YAAY,CAC1B,UAAA,UAAU,IAAI,OAAA,UAAU,GAAG,wCAAwC,EAArD,CAAqD,EACnE,iBAAiB,CAClB;SACF;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\nimport { parsePhoneNumberFromString, CountryCode } from 'libphonenumber-js';\n\nexport const IS_PHONE_NUMBER = 'isPhoneNumber';\n\n/**\n * Checks if the string is a valid phone number. To successfully validate any phone number the text must include\n * the intl. calling code, if the calling code wont be provided then the region must be set.\n *\n * @param value the potential phone number string to test\n * @param region 2 characters uppercase country code (e.g. DE, US, CH) for country specific validation.\n * If text doesn't start with the international calling code (e.g. +41), then you must set this parameter.\n */\nexport function isPhoneNumber(value: string, region?: CountryCode): boolean {\n  try {\n    const phoneNum = parsePhoneNumberFromString(value, region);\n    const result = phoneNum?.isValid();\n    return !!result;\n  } catch (error) {\n    // logging?\n    return false;\n  }\n}\n\n/**\n * Checks if the string is a valid phone number. To successfully validate any phone number the text must include\n * the intl. calling code, if the calling code wont be provided then the region must be set.\n *\n * @param region 2 characters uppercase country code (e.g. DE, US, CH) for country specific validation.\n * If text doesn't start with the international calling code (e.g. +41), then you must set this parameter.\n */\nexport function IsPhoneNumber(region?: CountryCode, validationOptions?: ValidationOptions): PropertyDecorator {\n  return ValidateBy(\n    {\n      name: IS_PHONE_NUMBER,\n      constraints: [region],\n      validator: {\n        validate: (value, args): boolean => isPhoneNumber(value, args.constraints[0]),\n        defaultMessage: buildMessage(\n          eachPrefix => eachPrefix + '$property must be a valid phone number',\n          validationOptions\n        ),\n      },\n    },\n    validationOptions\n  );\n}\n"]}