-
Notifications
You must be signed in to change notification settings - Fork 14
Browser compat fix. #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi. Thanks for your PR! I will take a look. |
Not really. I do expect a File.stream to return async iterable, no matter whether it Node.js |
Codecov Report
@@ Coverage Diff @@
## master #13 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 10 +1
Lines 541 584 +43
Branches 76 81 +5
=========================================
+ Hits 541 584 +43
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I did small code review. Other than the things I mentioned, everything else is good. |
Hi, I will make the aforementioned changes hopefully sometime today if not Friday (holiday here tomorrow). |
You know what? I'll probably just merge it as it is and do everything myself. Or do those changes in PR, whatever. Thank you for your participation! And happy holidays :) |
Reverted your ESLint fix, because I don't see any errors both on my local machine and on GitHub action. |
Also, added a test case for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
The fix is available in https://github.com/octet-stream/form-data-encoder/releases/tag/v2.1.4 |
Hi. This library works quite well other than the fact that in the browser, the AsyncGenerator does not work.
This is because
encoder.encode
checks each part, and if the part is aFile
, it expectspart.stream()
to be a nodestream.Readable
.This patch will use a duck-type check to see if it is a
ReadableStream
by checking for presence of agetReader
method and then yielding values from the reader. It falls back to the original behavior otherwise.ETA: There was also a small eslint issue that needed to be resolved.