@alextheman/utility - v4.3.5
    Preparing search index...

    Function parseFormData

    Returns an object given FormData and an optional data parser function to call on the resulting object.

    The type of the resulting object when called from the dataParser.

    The FormData to parse.

    An optional parser to call on the object before it gets returned.

    A parsed object based on the contents of the input formData and the result of parsing with the data parser if provided.

    • Returns a parsed object given FormData and a data parser function to call on the resulting object.

      Type Parameters

      • DataType

        The type of the resulting object when called from the dataParser.

      Parameters

      • formData: FormData

        The FormData to parse.

      • dataParser: (data: Record<string, string | Blob>) => DataType

        A parser to call on the object before it gets returned.

      Returns DataType

      A parsed object based on the contents of the input formData and the result of parsing with the data parser.

    • Returns an object given FormData.

      Parameters

      • formData: FormData

        The FormData to parse.

      Returns Record<string, string | Blob>

      An object based on the contents of the input formData.