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

100% Statements 5/5
100% Branches 0/0
100% Functions 3/3
100% Lines 4/4

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

    1x
    1x
    1x
    1x

     /**
     * Binds parameters decorators to the particular method
     * Useful when the language doesn't provide a 'Parameter Decorators' feature (vanilla JavaScript)
     * @param  {} ...decorators
     */
    export function Bind(...decorators: any[]) {
      return (target: object, key, descriptor) => {
        decorators.forEach((fn, index) => fn(target, key, index));
        return descriptor;
      };
    }