MCPcopy
hub / github.com/nestjs/nest / insertMiddleware

Method insertMiddleware

packages/core/middleware/container.ts:42–54  ·  view source on GitHub ↗
(metatype: T)

Source from the content-addressed store, hash-verified

40
41 const configurations = configList || [];
42 const insertMiddleware = <T extends Type<unknown>>(metatype: T) => {
43 const token = metatype;
44 middleware.set(
45 token,
46 new InstanceWrapper({
47 scope: getClassScope(metatype),
48 durable: isDurable(metatype),
49 name: token?.name ?? token,
50 metatype,
51 token,
52 }),
53 );
54 };
55 configurations.forEach(config => {
56 [].concat(config.middleware).map(insertMiddleware);
57 targetConfig.add(config);

Callers

nothing calls this directly

Calls 3

getClassScopeFunction · 0.90
isDurableFunction · 0.90
setMethod · 0.65

Tested by

no test coverage detected