Skip to content
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

Centralise the checks for blob and form data support #78

Merged
merged 2 commits into from
Jan 24, 2015

Conversation

matthew-andrews
Copy link
Contributor

This helps with isomorphic-fetch (currently it's relying on a fork that has these extra few lines:- https://github.com/matthew-andrews/fetch/blob/master/fetch.js#L3-5) and (I think) makes fetch's implementation simpler.

@@ -109,9 +110,9 @@
this._bodyInit = body
if (typeof body === 'string') {
this._bodyText = body
} else if ('Blob' in self && Blob.prototype.isPrototypeOf(body)) {
} else if (blobSupport && Blob.prototype.isPrototypeOf(body)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't sure about this because blobSupport actually checks a lot more than just 'Blob' in self

@josh
Copy link
Contributor

josh commented Jan 24, 2015

If it would help you more, I wouldn't mind centralizing all the checks to the top with a single object like

var support = {
  "Blob": howeverTestBlob,
  "FileReader": somethingTestFileReader
}

We could even export it as fetch._support if you wanted to runtime hack or inspect it.

@matthew-andrews
Copy link
Contributor Author

Umm, I don't mind. I would just like it to do its checks upfront so that I can restore self after requireing fetch.

I can definitely tidy them all up into a single object though.

@josh
Copy link
Contributor

josh commented Jan 24, 2015

❤️

josh added a commit that referenced this pull request Jan 24, 2015
Centralise the checks for blob and form data support
@josh josh merged commit 0c27c94 into JakeChampion:master Jan 24, 2015
@matthew-andrews
Copy link
Contributor Author

Would you mind if I made a (minor) release for this & #77?

@josh
Copy link
Contributor

josh commented Jan 24, 2015

no problem, done 115cd97

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants