Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const tagScope = (scope: ScopeType) => (target: any, key?: string, index?: number) => {
if (typeof index !== 'number') {
tagged(ScopeKeySymbol, scope)(target, key!, undefined)
return
}
// 判重
const metadata = Reflect.getMetadata(METADATA_KEY.TAGGED, target) || {}
const taggedList = metadata[index] || []
if (taggedList.every((tag: any) => tag.key !== ScopeKeySymbol)) {
tagged(ScopeKeySymbol, scope)(target, undefined as any, index)
}
}
const injectService = (service: any, target: any, key?: string, index?: number) => {
.forEach(klass => {
Reflect.deleteMetadata(METADATA_KEY.PARAM_TYPES, klass);
Reflect.deleteMetadata(METADATA_KEY.TAGGED, klass);
});
}