@gait-as/data-converter
v1.0.7
Published
Convert files to desired format
Downloads
12
Keywords
Readme
Data converter
A library for converting data to a desired format
Installation
npm install @gait-as/file-converter
Usage
blobToFormData
const { blobToFormData } = import "gait-as/data-converter"
const formData = blobToFormData(blob)
blobsToFormData
Takes an array of blobs, appends them to and returns a new FormData object
const { blobsToFormData } = import "gait-as/data-converter"
const formData = blobsToFormData(blobs)
base64ToFormData
Converts a Base64 string to a FormData object with a singular key value pair
const { base64ToFormData } = import "gait-as/data-converter"
const formData = base64ToFormData(base64String, 'mimeType')
base64ToBlob
Converts a Base64 encoded string to a Blob object
const { base64ToBlob } = import "gait-as/data-converter"
const blob = base64ToFormData(base64String, 'mimeType')