UNPKG

ayanami

Version:
14 lines (13 loc) 579 B
export const SameScopeMetadataKey = Symbol('SameScopeInjectionParams'); export const SameScope = () => ( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types target, _propertyKey, parameterIndex) => { let sameScopeInjectionParams = []; if (Reflect.hasMetadata(SameScopeMetadataKey, target)) { sameScopeInjectionParams = Reflect.getMetadata(SameScopeMetadataKey, target); } else { Reflect.defineMetadata(SameScopeMetadataKey, sameScopeInjectionParams, target); } sameScopeInjectionParams[parameterIndex] = true; };