Skip to content

Commit

Permalink
ramda 0.29.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kedashoe committed Oct 5, 2023
1 parent 3f8cb64 commit b565c21
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 590 deletions.
33 changes: 12 additions & 21 deletions docs/dist/ramda.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Ramda v0.29.0
// Ramda v0.29.1
// https://github.com/ramda/ramda
// (c) 2013-2023 Scott Sauyet, Michael Hurley, and David Chambers
// Ramda may be freely distributed under the MIT license.
Expand Down Expand Up @@ -282,6 +282,7 @@
var argsIdx = 0;
var left = length;
var combinedIdx = 0;
var hasPlaceholder = false;

while (combinedIdx < received.length || argsIdx < arguments.length) {
var result;
Expand All @@ -297,12 +298,14 @@

if (!_isPlaceholder(result)) {
left -= 1;
} else {
hasPlaceholder = true;
}

combinedIdx += 1;
}

return left <= 0 ? fn.apply(this, combined) : _arity(left, _curryN(length, combined, fn));
return !hasPlaceholder && left <= 0 ? fn.apply(this, combined) : _arity(Math.max(0, left), _curryN(length, combined, fn));
};
}

Expand Down Expand Up @@ -840,6 +843,7 @@
* R.type([]); //=> "Array"
* R.type(/[A-z]/); //=> "RegExp"
* R.type(() => {}); //=> "Function"
* R.type(async () => {}); //=> "AsyncFunction"
* R.type(undefined); //=> "Undefined"
*/

Expand Down Expand Up @@ -3608,23 +3612,7 @@
* - `g(_, 2)(_, 3)(1)`
*
* Please note that default parameters don't count towards a [function arity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/length)
* and therefore `curry` won't work well with those:
*
* ```
* const h = R.curry((a, b, c = 2) => a + b + c);
*
* h(40);
* //=> function (waits for `b`)
*
* h(39)(1);
* //=> 42
*
* h(1)(2, 3);
* //=> 6
*
* h(1)(2)(7);
* //=> Error! (`3` is not a function!)
* ```
* and therefore `curry` won't work well with those.
*
* @func
* @memberOf R
Expand All @@ -3637,11 +3625,14 @@
* @example
*
* const addFourNumbers = (a, b, c, d) => a + b + c + d;
*
* const curriedAddFourNumbers = R.curry(addFourNumbers);
* const f = curriedAddFourNumbers(1, 2);
* const g = f(3);
* g(4); //=> 10
*
* // R.curry not working well with default parameters
* const h = R.curry((a, b, c = 2) => a + b + c);
* h(1)(2)(7); //=> Error! (`3` is not a function!)
*/

var curry = _curry1(function curry(fn) {
Expand Down Expand Up @@ -9742,7 +9733,7 @@
return result;
}

result = [].concat(result.slice(0, positiveMin)).concat(result[positiveMax]).concat(result.slice(positiveMin + 1, positiveMax)).concat(result[positiveMin]).concat(result.slice(positiveMax + 1, length));
result = [].concat(result.slice(0, positiveMin)).concat([result[positiveMax]]).concat(result.slice(positiveMin + 1, positiveMax)).concat([result[positiveMin]]).concat(result.slice(positiveMax + 1, length));
return result;
};

Expand Down
Loading

0 comments on commit b565c21

Please sign in to comment.