UNPKG

routing-controllers

Version:

Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.

20 lines 725 B
import { getMetadataArgsStorage } from '../index'; /** * Injects a State object to the controller action parameter. * Must be applied on a controller action parameter. */ export function State(objectName) { return function (object, methodName, index) { getMetadataArgsStorage().params.push({ type: 'state', object: object, method: methodName, index: index, name: objectName, parse: false, // it does not make sense for Session to be parsed required: true, // when we demand session object, it must exist (working session middleware) classTransform: undefined, }); }; } //# sourceMappingURL=State.js.map