-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
fix(types): fix file blob type for uploadFile and uploadFiles #950
Merged
prescottprue
merged 12 commits into
prescottprue:v3.5.1
from
rscotten:fix-file-blob-type
May 31, 2020
Merged
fix(types): fix file blob type for uploadFile and uploadFiles #950
prescottprue
merged 12 commits into
prescottprue:v3.5.1
from
rscotten:fix-file-blob-type
May 31, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merge parent master into master
merge head into fork
merge master
merge master
2 tasks
Codecov Report
@@ Coverage Diff @@
## master #950 +/- ##
=======================================
Coverage 88.33% 88.33%
=======================================
Files 29 29
Lines 797 797
=======================================
Hits 704 704
Misses 93 93 |
@@ -10,6 +10,8 @@ import { Dispatch } from 'redux' | |||
*/ | |||
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> | |||
|
|||
type FileOrBlob<T> = T extends File ? File : Blob |
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.
Nice!
Thanks for getting this in so quickly! |
prescottprue
added a commit
that referenced
this pull request
May 31, 2020
* fix(types): fix file blob type for uploadFile and uploadFiles (#950) - @rscotten * chore(docs): cleanup minor typo in useFirestoreConnect.md (#949) - @gregfenton * chore(tests): fix typo "merge" to "merges" in reducer test file (#948) - @yukimurasawa * chore(docs): remove note about populate not being supported in firestore (#915) * chore(examples): clarify explanation in `watchEvent` example snippet (#910) * chore(docs): add correct syntax highlighting to example in firestore.md * chore(build): improve lint command * chore(build): only require jsdoc comments in source Co-authored-by: Richard Scotten <[email protected]> Co-authored-by: gregfenton <[email protected]> Co-authored-by: yukimurasawa <[email protected]> Co-authored-by: yukimurasawa <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a type issue in the PR #936 in which the
uploadFile()
function for file storage uploading was allowed to take aBlob
type. Typing the file option to haveFile | Blob
broke the type checking for theUploadFileOptions
type definition, and my solution was to make the type generic with Conditional Types.Check List
If not relevant to pull request, check off as complete
Relevant Issues
#936