| 143 | * @param group - Group for ordering the interceptor |
| 144 | */ |
| 145 | export 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 |