HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/api-parametros/node_modules/class-validator/cjs/decorator/string/IsTimeZone.js.map
{"version":3,"file":"IsTimeZone.js","sourceRoot":"","sources":["../../../../src/decorator/string/IsTimeZone.ts"],"names":[],"mappings":";;;AACA,qDAAgE;AAEnD,QAAA,WAAW,GAAG,YAAY,CAAC;AAExC;;;GAGG;AACH,SAAgB,UAAU,CAAC,KAAc;IACvC,IAAI,CAAC;QACH,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,oGAAoG;QACpG,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;QAEpD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,SAAS,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAbD,gCAaC;AAED;;;GAGG;AACH,SAAgB,UAAU,CAAC,iBAAqC;IAC9D,OAAO,IAAA,uBAAU,EACf;QACE,IAAI,EAAE,mBAAW;QACjB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;YACrD,cAAc,EAAE,IAAA,yBAAY,EAC1B,UAAU,CAAC,EAAE,CAAC,UAAU,GAAG,0CAA0C,EACrE,iBAAiB,CAClB;SACF;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAdD,gCAcC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\n\nexport const IS_TIMEZONE = 'isTimeZone';\n\n/**\n * Checks if the string represents a valid IANA timezone\n * If the given value is not a valid IANA timezone, then it returns false.\n */\nexport function isTimeZone(value: unknown): boolean {\n  try {\n    if (typeof value !== 'string') {\n      return false;\n    }\n\n    /** Specifying an invalid time-zone will raise a `RangeError: Invalid time zone specified` error. */\n    Intl.DateTimeFormat(undefined, { timeZone: value });\n\n    return true;\n  } catch (exception) {\n    return false;\n  }\n}\n\n/**\n * Checks if the string represents a valid IANA timezone\n * If the given value is not a valid IANA timezone, then it returns false.\n */\nexport function IsTimeZone(validationOptions?: ValidationOptions): PropertyDecorator {\n  return ValidateBy(\n    {\n      name: IS_TIMEZONE,\n      validator: {\n        validate: (value, args): boolean => isTimeZone(value),\n        defaultMessage: buildMessage(\n          eachPrefix => eachPrefix + '$property must be a valid IANA time-zone',\n          validationOptions\n        ),\n      },\n    },\n    validationOptions\n  );\n}\n"]}