Skip to content

Commit

Permalink
fix: incorrect File.stream() object this reference (#2672)
Browse files Browse the repository at this point in the history
* fix: incorrect File.stream() object this reference
* chore(style): remove trailing spaces
  • Loading branch information
Banou26 committed Oct 2, 2023
1 parent d07334f commit 8577a47
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/file.js
Expand Up @@ -144,16 +144,15 @@ export default class File extends EventEmitter {
stream (opts) {
let iterator
return new ReadableStream({
start () {
start: () => {
iterator = this[Symbol.asyncIterator](opts)
},
async pull ({ close, enqueue }) {
async pull (controller) {
const { value, done } = await iterator.next()

if (done) {
close()
controller.close()
} else {
enqueue(value)
controller.enqueue(value)
}
},
cancel () {
Expand Down

0 comments on commit 8577a47

Please sign in to comment.