We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
createFlow
1 parent 34ca4f3 commit 379b7a0Copy full SHA for 379b7a0
.internal/createFlow.js
@@ -9,19 +9,18 @@ function createFlow(fromRight) {
9
return (...funcs) => {
10
const length = funcs.length;
11
12
- let func;
13
- let wrapper;
14
let index = length;
15
16
if (fromRight) {
17
funcs.reverse();
18
}
+
19
while (index--) {
20
- func = funcs[index];
21
- if (typeof func != 'function') {
+ if (typeof funcs[index] !== 'function') {
22
throw new TypeError('Expected a function');
23
24
25
return function(...args) {
26
const value = args[0];
27
let index = 0;
@@ -30,6 +29,7 @@ function createFlow(fromRight) {
30
29
while (++index < length) {
31
result = funcs[index].call(this, result);
32
33
return result;
34
};
35
0 commit comments