import 'reflect-metadata' ; import { RequestHandler } from 'express' ; import { MetadataKeys } from './MetadataKeys' ; export function use ( middleware ) { return function ( target , key , desc ) { const middlewares = Reflect . getMetadata ( MetadataKeys . middleware , target , key ) || [ ] ; Reflect . defineMetadata ( MetadataKeys . middleware , [ ... middlewares , middleware ] , target , key ) ; } ; }