Permalink
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/ary.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

29 lines (26 sloc)
857 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var createWrap = require('./_createWrap'); | |
/** Used to compose bitmasks for function metadata. */ | |
var WRAP_ARY_FLAG = 128; | |
/** | |
* Creates a function that invokes `func`, with up to `n` arguments, | |
* ignoring any additional arguments. | |
* | |
* @static | |
* @memberOf _ | |
* @since 3.0.0 | |
* @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; | |
n = (func && n == null) ? func.length : n; | |
return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); | |
} | |
module.exports = ary; |