{"version":3,"file":"handleDecorator.mjs","sourceRoot":"","sources":["../../../src/decorators/handleDecorator.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,0BAA0B,OAAyB;IACxD,MAAM,CAAC,UAAS,MAAW,EAAE,WAAoB,EAAE,UAA+B;QACjF,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC;YAClC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACtC,CAAC;QAAC,IAAI,CAAC,CAAC;YACP,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC;AACH,CAAC;AAED,eAAe,eAAe,CAAC","sourcesContent":["export type DecoratorHandler = (target: any, propertyKey?: string) => void;\n\n/**\n * Generic decorator handler to take care of whether or not the decorator was called at the class level\n * or the method level.\n *\n * @param handler\n */\nexport function handleDecorator(handler: DecoratorHandler) {\n\treturn function(target: any, propertyKey?: string, descriptor?: PropertyDescriptor) {\n\t\tif (typeof target === 'function') {\n\t\t\thandler(target.prototype, undefined);\n\t\t} else {\n\t\t\thandler(target, propertyKey);\n\t\t}\n\t};\n}\n\nexport default handleDecorator;\n"]}