We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function curry(fn, params, hole) { let fnLen = fn.length; params = params || []; return function (...p) { for (let i = 0; i < params.length && p.length; i++) { if (params[i] === hole) { params[i] = p.shift(); } } let paramsAll = [...params, ...p];
if (paramsAll.filter((v) => v !== hole).length < fnLen) { return curry.call(this, fn, paramsAll, hole); } else { return fn.apply(this, paramsAll); }
}; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
function curry(fn, params, hole) {
let fnLen = fn.length;
params = params || [];
return function (...p) {
for (let i = 0; i < params.length && p.length; i++) {
if (params[i] === hole) {
params[i] = p.shift();
}
}
let paramsAll = [...params, ...p];
};
}
The text was updated successfully, but these errors were encountered: