All files injectDecoratoryFactory.ts

100% Statements 7/7
100% Branches 0/0
100% Functions 2/2
100% Lines 5/5

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  1x 1x 1x                 2x 1x  
import { Inject } from '@nestjs/common';
 
/**
 * Creates a decorator that can be used as a convenience to inject a specific token
 *
 * Instead of using @Inject(SOME_THING_TOKEN) this can be used to create a new named Decorator
 * such as @InjectSomeThing() which will hide the token details from users making APIs easier
 * to consume
 * @param token
 */
export const makeInjectableDecorator =
  (token: string | symbol): (() => ParameterDecorator) =>
  () =>
    Inject(token);