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