R.allPass doesn't accept more than 1 parameters for function predicates
mohit61 opened this issue · 12 comments
R.allPass is returning false for this case
var plusEq = function(w, x, y, z) {return w + x === y + z; };
console.log(R.allPass([plusEq])(3,3,3,3))
output:
false
same with R.anyPass
will check it out. thanks for the report.
A fix is applied and will be available with 6.10.0
. I'll keep the issue open until the release.
I am closing the issue as the fix is released with version 7.0.0
.
@selfrefactor TypeScript typing seems to be outdated:
/**
* It returns `true`, if all functions of `predicates` return `true`, when `input` is their argument.
*/
export function allPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
will check it out. txs
A fix is indeed applies.
This snippet export function allPass<T>(predicates: ((x: T) => boolean)[]): (input: T) => boolean;
is in the current TS file. Please check with the latest version.
If you test on REPL, then there it is still the old version with the bug.
REPL is updated so you can see it working there as well
@selfrefactor I mean the typing is not correct, the predicates functions only accept one argument, maybe it should be:
export function allPass<T extends any[]>(predicates: ((...args: T) => boolean)[]): (...inputs: T) => boolean;
Thanks for correcting me. Then I will make the required changes and will release them with 7.3.0
.
A fix is applied and it will be released with next version.
done with 7.3.0