Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / ary.js
1 var createWrapper = require('./internal/createWrapper');
2
3 /** Used to compose bitmasks for wrapper metadata. */
4 var ARY_FLAG = 128;
5
6 /**
7  * Creates a function that accepts up to `n` arguments, ignoring any
8  * additional arguments.
9  *
10  * @static
11  * @memberOf _
12  * @category Function
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.
17  * @example
18  *
19  * _.map(['6', '8', '10'], _.ary(parseInt, 1));
20  * // => [6, 8, 10]
21  */
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);
26 }
27
28 module.exports = ary;