concat: Fix Wallaby.js bug.
This commit is contained in:
parent
9f8a0ee37c
commit
f5e88f4dda
1 changed files with 17 additions and 3 deletions
14
lib/index.js
14
lib/index.js
|
@ -112,9 +112,23 @@ const Channel = function(length = 0) {
|
|||
for (let index = 0; index < args.length; index++) {
|
||||
const arg = args[index];
|
||||
|
||||
/* For some reason the following code works in Mocha but not in
|
||||
Wallaby.js:
|
||||
|
||||
await (Channel.isChannel(arg)
|
||||
? arg.forEach(output.push)
|
||||
: 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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue