MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / value

Function value

packages/express/src/middleware-interceptor.ts:240–264  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238 }
239
240 value(): GenericInterceptor<CTX> {
241 return async (ctx, next) => {
242 // Get the latest configuration
243 if (this.middlewareConfigView != null) {
244 this.middlewareConfig =
245 (await this.middlewareConfigView.singleValue()) ??
246 this.middlewareConfig;
247 }
248
249 if (this.interceptor == null) {
250 // Create a new interceptor for the first time or recreate it if it
251 // was reset to `null` when its configuration changed
252 debug(
253 'Creating interceptor for %s with config',
254 this.middlewareFactory.name,
255 this.middlewareConfig,
256 );
257 this.interceptor = createInterceptor(
258 this.middlewareFactory,
259 this.middlewareConfig,
260 );
261 }
262 return this.interceptor(ctx, next);
263 };
264 }
265}
266
267/**

Callers

nothing calls this directly

Calls 3

createInterceptorFunction · 0.85
singleValueMethod · 0.80
interceptorMethod · 0.80

Tested by

no test coverage detected