MCPcopy Create free account
hub / github.com/LeetCode-OpenSource/ayanami / addDecorator

Function addDecorator

src/ssr/express.ts:13–21  ·  view source on GitHub ↗
(target: any, method: any, middleware: any)

Source from the content-addressed store, hash-verified

11export const reqMap = new Map<Request, Map<any, { scope: string; req: Request }>>()
12
13function addDecorator(target: any, method: any, middleware: any) {
14 const existedMetas = Reflect.getMetadata(SSRSymbol, target)
15 const meta = { action: method, middleware }
16 if (existedMetas) {
17 existedMetas.push(meta)
18 } else {
19 Reflect.defineMetadata(SSRSymbol, [meta], target)
20 }
21}
22
23interface SSREffectOptions<Payload> {
24 /**

Callers 1

SSREffectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected