Function parameter

  • URL path parameter decoder.

    typia.http.parameter() is a function decoding a path parameter, with automatic type casting to the expected type. When type T has beeen defined as boolean or number type, typia.http.parameter() will cast the value to the expected type.

    Also, typia.http.parameter() performs type assertion to the decoded value by combining with assert function. Therefore, when the decoded value is not following the T type, TypeGuardError would be thrown.

    Type Parameters

    • T extends null | Type

      Expected type of decoded value

    Parameters

    • input: string

      Path parameter string

    Returns Resolved<T>

    Decoded path parameter value