-
Notifications
You must be signed in to change notification settings - Fork 370
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: correctly handle an empty file in download function #1995
Conversation
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.
looks good other than the extra line. thanks, denis!!
test/file.ts
Outdated
@@ -55,6 +55,7 @@ import { | |||
} from '../src/file'; | |||
import {ExceptionMessages, IdempotencyStrategy} from '../src/storage'; | |||
import {formatAsUTCISO} from '../src/util'; | |||
import {timeStamp} from 'console'; |
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.
remove unused variable
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.
When tab autocomplete goes wrong...
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, one optional comment
writable.write(data); | ||
fileStream.pipe(writable).on('error', callback).on('finish', callback); | ||
}); | ||
fileStream |
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.
[Optional]: Now we're on Node 12+ we can use for await (const chunk of readable)
to make this tinier: https://nodejs.org/api/stream.html#readablesymbolasynciterator
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.
Since this isn't within an async function currently I'm going to leave it alone for the time being until we modernize our function signatures.
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #1991 🦕