https://github.com/amruthpillai/crossform
A tiny typescript-first utility library to convert JavaScript Objects to FormData, and handle conversions the other way around.
https://github.com/amruthpillai/crossform
Last synced: 6 months ago
JSON representation
A tiny typescript-first utility library to convert JavaScript Objects to FormData, and handle conversions the other way around.
- Host: GitHub
- URL: https://github.com/amruthpillai/crossform
- Owner: AmruthPillai
- Created: 2024-02-14T08:59:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-03T16:58:11.000Z (over 1 year ago)
- Last Synced: 2024-05-23T08:23:38.182Z (over 1 year ago)
- Language: TypeScript
- Size: 85 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Crossform
A tiny typescript-first utility library to convert [JavaScript Objects](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) to [FormData](https://developer.mozilla.org/en-US/docs/Web/API/FormData), and handle conversions the other way around.
**The library exposes two functions:**
### `toFormData(data: Object)`
Accepts any serializable object and returns a flattened FormData instance.
### `toObject(formData: FormData)`
Accepts a FormData instance and returns an object parsed from the original format.