Releases: octet-stream/form-data-encoder
Releases · octet-stream/form-data-encoder
1.1.0
Update
- Get rid of nanoid in favour of
crypto.randomBytes
and focus on Node.js support only, because browsers can handle encoding themselves.
All changes: v1.0.1...v1.1.0
1.0.1
Update
- Add escaping for CR, LF and " symbols in
name
andfilename
params; - Add an alternative example for Blob as conversion target;
All changes: v1.0.0...v1.0.1
1.0.0 - First stable release
Add
- Expose
isFileLike
andisFormDataLike
Update
- Documentation improvements
- Loosen tests in
isFormDataLike
- Make private members actually private
All changes: v0.5.1...v1.0.0
0.5.1
Update
- Fix for 3rd example in documentation:
node-fetch
currently does not support async iterables, so the example is not valid when the encoder targetingfetch-blob@3
All changes: v0.5.0...v0.5.1
0.5.0
Update
- Lowercase default boundary string lead characters so it can be used when targeting the Encoder output to Blob:
import {FormData} from "formdata-polyfill/esm-min.js"
import {blobFrom} from "fetch-blob/from.js"
import {Encoder} from "form-data-encoder"
import Blob from "fetch-blob"
import fetch from "node-fetch"
async function toBlob(form) {
const encoder = new Encoder(form) // No need to use custom boundary with lowercased alphabetical characters anymore
const chunks = []
for await (const chunk of encoder) {
chunks.push(chunk)
}
return new Blob(chunks, {type: encoder.contentType})
}
const fd = new FormData()
fd.set("name", "John Doe")
fd.set("avatar", await blobFrom("path/to/an/avatar.png"), "avatar.png")
const options = {
method: "post",
body: await toBlob(fd)
}
await fetch("https://httpbin.org/post", options)
All changes: v0.4.0...v0.5.0
0.4.0
Update
- Put
TextEncoder
usage to the instance-wide scope and move CRLF and DASHES toEncoder
constructor - Behaviour compatibility fix: Do not try to guess
Content-Type
header for a File from itsname
property
Remove
- Because of behaviour changes in the
Encoder
, themime-types
package was removed from dependencies
All changes: v0.3.0...v0.4.0
0.3.0
Update
- Improve
Encoder#headers
API (make it an actual property) - Improve documentation and add more usage examples
All changes: v0.2.0...v0.3.0
0.2.0
Update
- Documentation improvements
- Replace
Buffer
withUint8Array
+TextEncoder
- The
Encoder#encode()
method now yieldsUint8Array
instead ofBuffer
All changes: v0.1.0...v0.2.0
0.1.0
Initial release
See readme.md for documentation