Skip to content

UseParam

@tsed/platform-params

Usage

typescript
import { UseParam } from "@tsed/platform-params";

See /packages/platform/platform-params/src/types/decorators/useParam.ts.

Overview

ts
function UseParam(options: Partial<ParamOptions>): ParameterDecorator;

Description

Register a new param. It uses the paramType to extract value and give it to the next pipe.

Given options allow to enable or disable following pipes:

  • useType: Add extra type for the json mapper,
  • expression: Get property from the returned value by the previous pipe.
  • useValidation: Apply validation from the returned value by the previous pipe.
  • useMapper: Apply json mapper from the returned value by the previous pipe.

Released under the MIT License.