# All files / core/pipes params-token-factory.ts

100% Statements 7/7
100% Branches 4/4
100% Functions 1/1
100% Lines 7/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    181x

    1x

    13x

    4x

    2x

    4x

    3x

     import { RouteParamtypes } from '@nestjs/common/enums/route-paramtypes.enum';
    import { Paramtype } from '@nestjs/common';

    export class ParamsTokenFactory {
      public exchangeEnumForString(type: RouteParamtypes): Paramtype {
        switch (type) {
          case RouteParamtypes.BODY:
            return 'body';
          case RouteParamtypes.PARAM:
            return 'param';
          case RouteParamtypes.QUERY:
            return 'query';
          default:
            return 'custom';
        }
      }
    }