Sindbad~EG File Manager

Current Path : /home/infinitibizsol/.trash/node_modules.2/class-validator/cjs/decorator/string/
Upload File :
Current File : /home/infinitibizsol/.trash/node_modules.2/class-validator/cjs/decorator/string/IsIP.js.map

{"version":3,"file":"IsIP.js","sourceRoot":"","sources":["../../../../src/decorator/string/IsIP.ts"],"names":[],"mappings":";;;;;;AACA,qDAAgE;AAChE,8DAA+C;AAIlC,QAAA,KAAK,GAAG,MAAM,CAAC;AAE5B;;;GAGG;AACH,SAAgB,IAAI,CAAC,KAAc,EAAE,OAAqB;IACxD,+EAA+E;IAC/E,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAE,GAAG,OAAO,EAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;IACrE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAA,cAAa,EAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AACvE,CAAC;AAJD,oBAIC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAqB,EAAE,iBAAqC;IAC/E,OAAO,IAAA,uBAAU,EACf;QACE,IAAI,EAAE,aAAK;QACX,WAAW,EAAE,CAAC,OAAO,CAAC;QACtB,SAAS,EAAE;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAW,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,CAAC,CAAC,CAAC,CAAC;YACrE,cAAc,EAAE,IAAA,yBAAY,EAAC,UAAU,CAAC,EAAE,CAAC,UAAU,GAAG,iCAAiC,EAAE,iBAAiB,CAAC;SAC9G;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAZD,oBAYC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\nimport isIPValidator from 'validator/lib/isIP';\n\nexport type IsIpVersion = '4' | '6' | 4 | 6;\n\nexport const IS_IP = 'isIp';\n\n/**\n * Checks if the string is an IP (version 4 or 6).\n * If given value is not a string, then it returns false.\n */\nexport function isIP(value: unknown, version?: IsIpVersion): boolean {\n  /* eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion */\n  const versionStr = version ? (`${version}` as '4' | '6') : undefined;\n  return typeof value === 'string' && isIPValidator(value, versionStr);\n}\n\n/**\n * Checks if the string is an IP (version 4 or 6).\n * If given value is not a string, then it returns false.\n */\nexport function IsIP(version?: IsIpVersion, validationOptions?: ValidationOptions): PropertyDecorator {\n  return ValidateBy(\n    {\n      name: IS_IP,\n      constraints: [version],\n      validator: {\n        validate: (value, args): boolean => isIP(value, args?.constraints[0]),\n        defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be an ip address', validationOptions),\n      },\n    },\n    validationOptions\n  );\n}\n"]}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists