nestwhats
Version:
A whatsapp-web.js wrapper for NestJS to create WhatsApp bots
12 lines (11 loc) • 622 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createNestWhatsParamDecorator = createNestWhatsParamDecorator;
const common_1 = require("@nestjs/common");
const constants_1 = require("@nestjs/common/constants");
function createNestWhatsParamDecorator(type) {
return (...pipes) => (target, key, index) => {
const args = Reflect.getMetadata(constants_1.ROUTE_ARGS_METADATA, target.constructor, key) || {};
Reflect.defineMetadata(constants_1.ROUTE_ARGS_METADATA, (0, common_1.assignMetadata)(args, type, index, undefined, ...pipes), target.constructor, key);
};
}