Remove semicolons.

This commit is contained in:
John-David Dalton
2017-02-04 23:50:10 -08:00
parent f3a8e55e70
commit 6cb3460fce
452 changed files with 4261 additions and 4261 deletions

24
flow.js
View File

@@ -11,29 +11,29 @@
* @example
*
* function square(n) {
* return n * n;
* return n * n
* }
*
* const addSquare = flow([add, square]);
* addSquare(1, 2);
* const addSquare = flow([add, square])
* addSquare(1, 2)
* // => 9
*/
function flow(funcs) {
const length = funcs ? funcs.length : 0;
let index = length;
const length = funcs ? funcs.length : 0
let index = length
while (index--) {
if (typeof funcs[index] != 'function') {
throw new TypeError('Expected a function');
throw new TypeError('Expected a function')
}
}
return function(...args) {
let index = 0;
let result = length ? funcs[index].apply(this, args) : args[0];
let index = 0
let result = length ? funcs[index].apply(this, args) : args[0]
while (++index < length) {
result = funcs[index].call(this, result);
result = funcs[index].call(this, result)
}
return result;
};
return result
}
}
export default flow;
export default flow