• Adds a value to a FormData object, handling different value types appropriately.

    Parameters

    • formData: FormData

      the FormData object to which the value will be added

    • key: string

      the key under which the value will be stored in the FormData object

    • value: Value

      the value to be added to the FormData object

    Returns void

    Example

    addValueToFD(formData, 'string', 'value');
    addValueToFD(formData, 'array', ['value1', 'value2']);
    addValueToFD(formData, 'obj', { key: 'test' });
    addValueToFD(formData, 'file', file);

Generated using TypeDoc