imagekit-developer / imagekit-javascript

Javascript SDK for using ImageKit.io
https://imagekit.io
77 stars 26 forks source link

Allow upload tags as array #40

Closed harrygr closed 3 years ago

harrygr commented 3 years ago

Tags can be provided as an array rather than a comma-separated string as FormData will coerce it.


const form = new FormData()
form.append('tags', ['a', 'b'])
Object.fromEntries(form)
// Object { tags: "a,b" }
``
harrygr commented 3 years ago

It looks like the type definition of Form.prototype.append only allows strings and Blobs so, even though passing a string[] does work it's not technically compliant with the api. Closing...