@zerooneit/expressive-tea
Version:
A REST API over Express and Typescript
15 lines (14 loc) • 593 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.addAnnotation = void 0;
const MetaData_1 = require("../classes/MetaData");
const constants_1 = require("../libs/constants");
function addAnnotation(type, target, propertyKey, ...args) {
const annotations = MetaData_1.default.get(constants_1.ROUTER_ANNOTATIONS_KEY, target, propertyKey) || [];
annotations.unshift({
arguments: args,
type
});
MetaData_1.default.set(constants_1.ROUTER_ANNOTATIONS_KEY, annotations, target, propertyKey);
}
exports.addAnnotation = addAnnotation;
;