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

Function asGlobalInterceptor

packages/context/src/interceptor.ts:145–154  ·  view source on GitHub ↗
(group?: string)

Source from the content-addressed store, hash-verified

143 * @param group - Group for ordering the interceptor
144 */
145export function asGlobalInterceptor(group?: string): BindingTemplate {
146 return binding => {
147 binding
148 // Tagging with `GLOBAL_INTERCEPTOR` is required.
149 .tag(ContextTags.GLOBAL_INTERCEPTOR)
150 // `GLOBAL_INTERCEPTOR_NAMESPACE` is to make the binding key more readable.
151 .tag({[ContextTags.NAMESPACE]: GLOBAL_INTERCEPTOR_NAMESPACE});
152 if (group) binding.tag({[ContextTags.GLOBAL_INTERCEPTOR_GROUP]: group});
153 };
154}
155
156/**
157 * `@globalInterceptor` decorator to mark the class as a global interceptor

Callers 13

TracingInterceptorClass · 0.90
globalInterceptorFunction · 0.85
registerInterceptorFunction · 0.85
givenGlobalInterceptorFunction · 0.85
givenAClientFunction · 0.85

Calls 1

tagMethod · 0.80

Tested by 2

givenGlobalInterceptorFunction · 0.68
givenAClientFunction · 0.68