Closed
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...