rambda icon indicating copy to clipboard operation
rambda copied to clipboard

R.allPass doesn't accept more than 1 parameters for function predicates

Open mohit61 opened this issue 2 years ago • 11 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

mohit61 avatar Oct 27 '21 05:10 mohit61

same with R.anyPass

mohit61 avatar Oct 27 '21 05:10 mohit61

will check it out. thanks for the report.

selfrefactor avatar Oct 27 '21 07:10 selfrefactor

A fix is applied and will be available with 6.10.0. I'll keep the issue open until the release.

selfrefactor avatar Nov 21 '21 11:11 selfrefactor

I am closing the issue as the fix is released with version 7.0.0.

selfrefactor avatar Dec 25 '21 10:12 selfrefactor

@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;

NexZhu avatar Aug 03 '22 08:08 NexZhu

will check it out. txs

selfrefactor avatar Aug 03 '22 12:08 selfrefactor

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.

selfrefactor avatar Aug 05 '22 09:08 selfrefactor

REPL is updated so you can see it working there as well

selfrefactor avatar Aug 05 '22 10:08 selfrefactor

@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;

NexZhu avatar Aug 05 '22 15:08 NexZhu

Thanks for correcting me. Then I will make the required changes and will release them with 7.3.0.

selfrefactor avatar Aug 06 '22 07:08 selfrefactor

A fix is applied and it will be released with next version.

selfrefactor avatar Aug 14 '22 16:08 selfrefactor

done with 7.3.0

selfrefactor avatar Oct 01 '22 13:10 selfrefactor