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