Currently, as curry checks the number of passed parameters against the function's length property, curried functions can not have optional parameters, which can be frustrating at times.
Ideas
use curryN to define the minimum number of required parameters to make the function work. Execute the function as soon as that number has been reached
parse the toString() representation of the function to see how many optional parameters there are
Warning
additional parameters should only be the last parameters of a function
make sure additional parameters are not removed when using the non-curried version
const add = (a, b, c = 3)
curry(add)(1, 2) // should be 6
curry(add)(1, 2, 4) // should be 7
Currently, as
curry
checks the number of passed parameters against the function'slength
property, curried functions can not have optional parameters, which can be frustrating at times.Ideas
curryN
to define the minimum number of required parameters to make the function work. Execute the function as soon as that number has been reachedtoString()
representation of the function to see how many optional parameters there areWarning