Function form

  • Form data middleware factory

    Type Parameters

    Returns Middleware<I, O, I & {
        body: FormData;
    }, O>

    Remarks

    The returned middleware enriches the input with a body property containing the parsed form data.

    The returned middleware will only parse form data encoded as application/x-www-form-urlencoded.

  • Form data middleware factory

    Type Parameters

    • const T extends ZFromStringsMap
    • I extends Context
    • O

    Parameters

    • schema: T

      Schema to validate the form data with

    Returns Middleware<I, O, I & {
        body: TypeOf<T>;
    }, O>

    Remarks

    The returned middleware enriches the input with a body property containing the form data parsed and validated with the given schema.

    The returned middleware will only parse form data encoded as application/x-www-form-urlencoded.

  • Form data middleware factory

    Type Parameters

    • const K extends string
    • I extends Context
    • O

    Parameters

    • key: K

      Key to use for the form data property

    Returns Middleware<I, O, I & {
        [body in K]: FormData
    }, O>

    Remarks

    The returned middleware enriches the input with a property with the given key containing the parsed form data.

    The returned middleware will only parse form data encoded as application/x-www-form-urlencoded.

  • Form data middleware factory

    Type Parameters

    • const K extends string
    • const T extends ZFromStringsMap
    • I extends Context
    • O

    Parameters

    • key: K

      Key to use for the form data property

    • schema: T

      Schema to validate the form data with

    Returns Middleware<I, O, I & {
        [body in K]: TypeOf<T>
    }, O>

    Remarks

    The returned middleware enriches the input with a property with the given key containing the form data parsed and validated with the given schema.

    The returned middleware will only parse form data encoded as application/x-www-form-urlencoded.

Generated using TypeDoc