UNPKG

process-reporting-ts

Version:
22 lines (21 loc) 852 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BpmnElement = void 0; const aop_1 = require("./aop"); function BpmnElement(options) { /** * target: The prototype of the class (Object) * propertyKey: The name of the method (string | symbol). * descriptor: A TypedPropertyDescriptor — see the type, leveraging the Object.defineProperty under the hood. * * NOTE: It's very important here we do not use arrow function otherwise 'this' will be messed up due * to the nature how arrow function defines this inside. * */ return function (target, propertyKey, descriptor) { const originalFunc = descriptor.value; descriptor.value = (0, aop_1.descriptorFunction)(originalFunc, options); return descriptor; }; } exports.BpmnElement = BpmnElement;