-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.
Description
pipeline(
Readable.from('abc\ndef\nghi'),
Duplex.from(async function * (source) {
let rest = ''
for await (const chunk of source) {
const lines = (rest + chunk.toString()).split('\n')
rest = lines.pop()
for (const line of lines) {
yield line
}
}
yield rest
}),
async function * (source) {
let ret = ''
for await (const x of source) {
ret += x
}
assert.strictEqual(ret, 'abcdefghi')
},
common.mustCall(() => {}),
)
Replace Duplex.from(arg) with arg
and it works...
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.streamIssues and PRs related to the stream subsystem.Issues and PRs related to the stream subsystem.