Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1x 1x 4x 4x 4x 4x 4x | import { Keys } from "../Keys"; import { Type } from "../interfaces/IType"; export function InjectProperty<I = any>(key: string | Type<I>) { return function inject< T extends Record<K, I>, K extends string>(target: T, propertyKey: K) { const ctr = target.constructor; const metadata: any = Reflect.getMetadata(Keys.PROPERTY_INJECT_KEY, ctr) || {}; metadata[propertyKey] = key; Reflect.defineMetadata(Keys.PROPERTY_INJECT_KEY, metadata, ctr); }; } |