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/object/IsInstance.js.map
{"version":3,"file":"IsInstance.js","sourceRoot":"","sources":["../../../../src/decorator/object/IsInstance.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,CAAC,IAAM,WAAW,GAAG,YAAY,CAAC;AAExC;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,MAAe,EAAE,qBAAkD;IAC5F,OAAO,CACL,qBAAqB,IAAI,OAAO,qBAAqB,KAAK,UAAU,IAAI,MAAM,YAAY,qBAAqB,CAChH,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CACxB,UAAuC,EACvC,iBAAqC;IAErC,OAAO,UAAU,CACf;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,CAAC,UAAU,CAAC;QACzB,SAAS,EAAE;YACT,QAAQ,EAAE,UAAC,KAAK,EAAE,IAAI,IAAc,OAAA,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAtC,CAAsC;YAC1E,cAAc,EAAE,YAAY,CAAC,UAAC,UAAU,EAAE,IAAI;gBAC5C,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE;oBACvB,OAAO,UAAU,GAAG,2CAAoC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAc,CAAE,CAAC;iBAC9F;qBAAM;oBACL,OAAO,UAAU,GAAG,UAAG,WAAW,iEAA8D,CAAC;iBAClG;YACH,CAAC,EAAE,iBAAiB,CAAC;SACtB;KACF,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { ValidationOptions } from '../ValidationOptions';\nimport { buildMessage, ValidateBy } from '../common/ValidateBy';\n\nexport const IS_INSTANCE = 'isInstance';\n\n/**\n * Checks if the value is an instance of the specified object.\n */\nexport function isInstance(object: unknown, targetTypeConstructor: new (...args: any[]) => any): boolean {\n  return (\n    targetTypeConstructor && typeof targetTypeConstructor === 'function' && object instanceof targetTypeConstructor\n  );\n}\n\n/**\n * Checks if the value is an instance of the specified object.\n */\nexport function IsInstance(\n  targetType: new (...args: any[]) => any,\n  validationOptions?: ValidationOptions\n): PropertyDecorator {\n  return ValidateBy(\n    {\n      name: IS_INSTANCE,\n      constraints: [targetType],\n      validator: {\n        validate: (value, args): boolean => isInstance(value, args.constraints[0]),\n        defaultMessage: buildMessage((eachPrefix, args) => {\n          if (args.constraints[0]) {\n            return eachPrefix + `$property must be an instance of ${args.constraints[0].name as string}`;\n          } else {\n            return eachPrefix + `${IS_INSTANCE} decorator expects and object as value, but got falsy value.`;\n          }\n        }, validationOptions),\n      },\n    },\n    validationOptions\n  );\n}\n"]}