@dazejs/framework
Version:
Daze.js - A powerful web framework for Node.js
14 lines (12 loc) • 368 B
text/typescript
export const EncryptResponse: MethodDecorator | ClassDecorator = function (...args: any[]) {
// decorator class
if (args.length === 1) {
const [target] = args;
Reflect.defineMetadata('encrypt', true, target);
}
// decorator method
else {
const [target, name] = args;
Reflect.defineMetadata('encrypt', true, target.constructor, name);
}
};