Documentation
    Preparing search index...

    Function TypedParam

    • Type safe URL parameter decorator.

      TypedParam is a decorator function getting specific typed parameter from the HTTP request URL. It's almost same with the nest.Param, but TypedParam automatically casts parameter value to be following its type, and validates it.

      import { tags } from "typia";

      \@TypedRoute.Get("shopping/sales/:id/:no/:paused")
      public async pause(
      \@TypedParam("id", "uuid"), id: string & tags.Format<"uuid">,
      \@TypedParam("no") id: number & tags.Type<"uint32">
      \@TypedParam("paused") paused: boolean | null
      ): Promise<void>;

      Type Parameters

      • T extends string | number | bigint | boolean | null

      Parameters

      • name: string

        URL Parameter name

      • Optionalassert: (value: string) => T
      • Optionalvalidate: boolean

      Returns ParameterDecorator

      Parameter decorator

      Jeongho Nam - https://github.com/samchon