All files / domains/inject index.ts

100% Statements 19/19
100% Branches 0/0
100% Functions 5/5
100% Lines 19/19

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 15 16 17 18 19 20 21 22 23 24 25 2617x 17x 17x 17x 17x 17x 17x   57x 10x     17x 17x 2x 2x   17x 1x 1x   17x 1x 1x    
import { injectorRegistry, InjectorResolver } from './registry';
export {
  injectorRegistry,
  InjectorsIndex,
  InjectorResolver,
  InjectorResolverData,
} from './registry';
 
export function Inject(resolver: InjectorResolver): ParameterDecorator {
  return (target: Object, fieldName: string, argIndex: number) => {
    injectorRegistry.set(target.constructor, [fieldName, argIndex], resolver);
  };
}
 
export const Context = Inject(({ context }) => {
  return context;
});
 
export const Info = Inject(({ info }) => {
  return info;
});
 
export const Source = Inject(({ source }) => {
  return source;
});