concat: Fix Wallaby.js bug.

This commit is contained in:
David Braun 2018-02-20 14:42:04 -05:00
parent 9f8a0ee37c
commit f5e88f4dda

View file

@ -112,9 +112,23 @@ const Channel = function(length = 0) {
for (let index = 0; index < args.length; index++) { for (let index = 0; index < args.length; index++) {
const arg = args[index]; const arg = args[index];
/* For some reason the following code works in Mocha but not in
Wallaby.js:
await (Channel.isChannel(arg) await (Channel.isChannel(arg)
? arg.forEach(output.push) ? arg.forEach(output.push)
: output.push(arg)); : output.push(arg));
If we use the 'if' statement below then Wallaby.js is happy.
*/
if (Channel.isChannel(arg)) {
await arg.forEach(value => {
output.push(value);
});
} else {
await output.push(arg);
}
} }
output.close(); output.close();