UNPKG

reest

Version:

A library inspired by NestJS's elegance, specifically designed for efficient serverless API development on AWS Lambda. It streamlines the creation of microservices with automated Swagger documentation and enhanced decorator-based middleware support, makin

26 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Param = void 0; const ReturnType_1 = require("../utils/ReturnType"); function Param(paramName, options) { return function (target, propertyKey, parameterIndex) { const parameter = Reflect.getMetadata("design:paramtypes", target, propertyKey)[parameterIndex]; const metadataKey = `__routeParameters__${String(propertyKey)}`; const existingParameters = Reflect.getOwnMetadata(metadataKey, target, propertyKey) || []; existingParameters.push({ paramName, parameterIndex, type: "param", options: { ...options, schema: { ...options?.schema, type: (0, ReturnType_1.returnType)(parameter), }, }, }); Reflect.defineMetadata(metadataKey, existingParameters, target, propertyKey); }; } exports.Param = Param; //# sourceMappingURL=Param.js.map