mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Remove guard params.
This commit is contained in:
4
ary.js
4
ary.js
@@ -11,15 +11,13 @@ const WRAP_ARY_FLAG = 128
|
||||
* @category Function
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @param {number} [n=func.length] The arity cap.
|
||||
* @param- {Object} [guard] Enables use as an iteratee for methods like `map`.
|
||||
* @returns {Function} Returns the new capped function.
|
||||
* @example
|
||||
*
|
||||
* map(['6', '8', '10'], ary(parseInt, 1))
|
||||
* // => [6, 8, 10]
|
||||
*/
|
||||
function ary(func, n, guard) {
|
||||
n = guard ? undefined : n
|
||||
function ary(func, n) {
|
||||
n = (func && n == null) ? func.length : n
|
||||
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user