-
Notifications
You must be signed in to change notification settings - Fork 352
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
feat(adapter-fetch): Add support for handling binary data #332
Changes from all commits
3e15175
a7df943
6d28539
9138819
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,6 @@ node_js: | |
- '10' | ||
- '12' | ||
|
||
dist: trusty | ||
|
||
addons: | ||
chrome: stable | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,8 @@ | |
"dependencies": { | ||
"@pollyjs/adapter": "^4.2.1", | ||
"@pollyjs/utils": "^4.1.0", | ||
"detect-node": "^2.0.4" | ||
"detect-node": "^2.0.4", | ||
"to-arraybuffer": "^1.0.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok so looked more into it to see what was actually being built. We current have rollup-plugin-node-builtins setup which has support for using If I imported the buffer via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explains a lot, was very confused - thanks for looking into it |
||
}, | ||
"devDependencies": { | ||
"@pollyjs/core": "^4.2.1", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Buffer } from 'buffer/'; | ||
|
||
/** | ||
* Determine if the given buffer is utf8. | ||
* @param {Buffer} buffer | ||
*/ | ||
export default function isBufferUtf8Representable(buffer) { | ||
const utfEncodedBuffer = buffer.toString('utf8'); | ||
const reconstructedBuffer = Buffer.from(utfEncodedBuffer, 'utf8'); | ||
|
||
return reconstructedBuffer.equals(buffer); | ||
} |
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.
This dist is EOL and is no longer supported by Chrome. That was the reason for the failing builds.