diff options
Diffstat (limited to 'tools/eslint/node_modules/lodash/nthArg.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/nthArg.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/lodash/nthArg.js b/tools/eslint/node_modules/lodash/nthArg.js new file mode 100644 index 0000000000..bf95dd011f --- /dev/null +++ b/tools/eslint/node_modules/lodash/nthArg.js @@ -0,0 +1,25 @@ +var toInteger = require('./toInteger'); + +/** + * Creates a function that returns its nth argument. + * + * @static + * @memberOf _ + * @category Util + * @param {number} [n=0] The index of the argument to return. + * @returns {Function} Returns the new function. + * @example + * + * var func = _.nthArg(1); + * + * func('a', 'b', 'c'); + * // => 'b' + */ +function nthArg(n) { + n = toInteger(n); + return function() { + return arguments[n]; + }; +} + +module.exports = nthArg; |