From 77149382bc287aecb8a6f1c17a0ebe5c90dbbcf4 Mon Sep 17 00:00:00 2001 From: Felipe Parreira Date: Thu, 2 Jul 2020 19:19:34 -0300 Subject: [PATCH] fix(curry): account for when user passes in more arguments than function's arity --- source/curry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/curry.js b/source/curry.js index 3ea9b8e..6a0678d 100644 --- a/source/curry.js +++ b/source/curry.js @@ -3,7 +3,7 @@ const curry = ( f, arr = [], length = f.length ) => (...args) => ( - a => a.length === length ? + a => a.length >= length ? f(...a) : curry(f, a) )([...arr, ...args]);