-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
(#3877) - refactor binary #3877
Conversation
@@ -52,8 +53,8 @@ function fetchRequest(options, callback) { | |||
} | |||
|
|||
if (options.body && (options.body instanceof Blob)) { | |||
utils.readAsBinaryString(options.body, function(binary) { | |||
fetchOptions.body = utils.fixBinary(binary); |
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.
Here's where we can simplify by just directly using readAsArrayBuffer
.
As for file naming conventions, I think we should start moving away from |
Another note: this does increase the min+gz size from 47655 to 47725, probably due to the extra browserify boilerplate around each little function. |
testUtils.atob = function (arg) { | ||
return PouchDB.utils.atob(arg); | ||
}; | ||
|
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.
Trying to reduce our dependence on PouchDB.utils
in the tests.
forgot the commit message format. we can fix on the way in |
Move them out of `utils.js` and into their own separate files. None of this is a functional change, except for a small optimization I noticed in `request-browser.js`, where we can directly use `readAsArrayBuffer` instead of first converting to a binary string.
Move them out of `utils.js` and into their own separate files. None of this is a functional change, except for a small optimization I noticed in `request-browser.js`, where we can directly use `readAsArrayBuffer` instead of first converting to a binary string.
Move them out of `utils.js` and into their own separate files. None of this is a functional change, except for a small optimization I noticed in `request-browser.js`, where we can directly use `readAsArrayBuffer` instead of first converting to a binary string.
all makes sense, cheers - 2376abe |
Move them out of
utils.js
and into their own separate files.None of this is a functional change, except for a small optimization
I noticed in
request-browser.js
, where we can directly usereadAsArrayBuffer
instead of first converting to a binary string.