1 var createWrapper = require('./internal/createWrapper');
3 /** Used to compose bitmasks for wrapper metadata. */
7 * Creates a function that accepts up to `n` arguments, ignoring any
8 * additional arguments.
13 * @param {Function} func The function to cap arguments for.
14 * @param {number} [n=func.length] The arity cap.
15 * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`.
16 * @returns {Function} Returns the new function.
19 * _.map(['6', '8', '10'], _.ary(parseInt, 1));
22 function ary(func, n, guard) {
23 n = guard ? undefined : n;
24 n = (func && n == null) ? func.length : n;
25 return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);