All files / domains/arg index.ts

64.71% Statements 11/17
62.5% Branches 5/8
66.67% Functions 2/3
66.67% Lines 10/15

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 1319x               19x 19x 19x 19x 19x
import { argRegistry } from './registry';
export { compileFieldArgs } from './compiler';
import { ArgOptions, defaultArgOptions } from './options';

export function Arg(options: ArgOptions = {}): ParameterDecorator {
  return (target: Object, fieldName: string, argIndex: number) => {
    argRegistry.set(target.constructor, [fieldName, argIndex], {
      ...defaultArgOptions,
      ...options,
    });
  };
}