Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadInterceptors() {
let interceptors =
MetadataInspector.getMethodMetadata(
INTERCEPT_METHOD_KEY,
this.target,
this.methodName,
) ?? [];
const targetClass =
typeof this.target === 'function' ? this.target : this.target.constructor;
const classInterceptors =
MetadataInspector.getClassMetadata(INTERCEPT_CLASS_KEY, targetClass) ??
[];
// Inserting class level interceptors before method level ones
interceptors = mergeInterceptors(classInterceptors, interceptors);
const globalInterceptors = this.getGlobalInterceptorBindingKeys();
// Inserting global interceptors
interceptors = mergeInterceptors(globalInterceptors, interceptors);
debug('Interceptors for %s', this.targetName, interceptors);
return interceptors;