from: Support 'mapfn'.

This commit is contained in:
David Braun 2017-10-22 02:59:29 -04:00
parent 6b577ea6cd
commit 8088d7e096
No known key found for this signature in database
GPG key ID: 5694EEC4D129BDCF
3 changed files with 16 additions and 4 deletions

View file

@ -55,6 +55,15 @@ describe(`Channel`, function() {
assert.deepEqual(await Channel.from([0, 1, 2]).values(), [0, 1, 2]);
});
it(`mapfn`, async function() {
assert.deepEqual(
await Channel.from([`a`, `b`, `c`], value =>
value.toUpperCase()
).values(),
[`A`, `B`, `C`]
);
});
it(`Node.js's stream.readOnly`, async function() {
const readOnly = stream.PassThrough({ objectMode: true });
readOnly.write(0);