Tweaked gitignore

gitignore removed all composer and npm files, so automated builds would fail
This commit is contained in:
Henry Whitaker
2020-04-12 21:24:03 +01:00
parent 698687f12d
commit ea5808047f
27863 changed files with 3399604 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
import arityN from 'arity-n';
let compose2 = (f, g) => (...args) => f(g(...args));
export default function compose(...functions) {
const funcs = functions.filter(fn => typeof fn === 'function');
let lastIdx = funcs.length - 1;
let arity = 0;
if (funcs.length <= 0) {
throw new Error('No funcs passed');
}
if (lastIdx >= 0 && funcs[lastIdx]) {
arity = funcs[lastIdx].length;
}
return arityN(funcs.reduce(compose2), arity);
}