Skip to content

Commit

Permalink
Improve documentation for objectToFormData
Browse files Browse the repository at this point in the history
  • Loading branch information
octet-stream committed Feb 18, 2024
1 parent d784a2b commit e098774
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/objectToFormData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,32 +95,35 @@ export interface ObjectToFormDataOptions {
normalizeValue?: NormalizeValue
}

/**
* Transforms given object, array, or collection to FormData object
*/
export interface ObjectToFormData {
/**
* Transform given object, array, or collection to FormData object
* Transforms given object, array, or collection to FormData object
*
* @param input - An object to transform
*/
(input: Input): FormData

/**
* Transform given object, array, or collection to FormData object
* Transforms given object, array, or collection to FormData object
*
* @param input - An object to transform
* @param strict - Indicates whether or not to omit every `false` values. Applied enabled. Does not affect boolean array values.
*/
(input: Input, strict?: boolean): FormData

/**
* Transform given object, array, or collection to FormData object
* Transforms given object, array, or collection to FormData object
*
* @param input - An object to transform
* @param oprions - Additional serialization options
*/
(input: Input, options?: ObjectToFormDataOptions): FormData

/**
* Transform given object, array, or collection to FormData object.
* Transforms given object, array, or collection to FormData object.
*
* **This method always enables `strict` option.**
*
Expand All @@ -129,6 +132,9 @@ export interface ObjectToFormData {
strict(input: Input): FormData
}

/**
* Transforms given object, array, or collection to FormData object
*/
export const objectToFormData: ObjectToFormData = (
input: Input,
optionsOrStrict?: ObjectToFormDataOptions | boolean
Expand Down

0 comments on commit e098774

Please sign in to comment.