# All files / common/decorators/core dependencies.decorator.ts

100% Statements 8/8
50% Branches 1/2
100% Functions 3/3
100% Lines 8/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    141x

    1x
    2x
    2x

    1x
    2x
    2x
    2x

     import { PARAMTYPES_METADATA } from '../../constants';

    export function flatten(arr: any[]) {
      const flat = [].concat(...arr);
      return flat.some(Array.isArray) ? flatten(flat) : flat;
    }

    export const Dependencies = (...dependencies: any[]): ClassDecorator => {
      const flattenDeps = flatten(dependencies);
      return (target: object) => {
        Reflect.defineMetadata(PARAMTYPES_METADATA, flattenDeps, target);
      };
    };