c18ebd8cdef0a2e85f7217f4491652296c4f18c7
[yaffs-website] / node_modules / uncss / node_modules / lodash / unary.js
1 var ary = require('./ary');
2
3 /**
4  * Creates a function that accepts up to one argument, ignoring any
5  * additional arguments.
6  *
7  * @static
8  * @memberOf _
9  * @category Function
10  * @param {Function} func The function to cap arguments for.
11  * @returns {Function} Returns the new function.
12  * @example
13  *
14  * _.map(['6', '8', '10'], _.unary(parseInt));
15  * // => [6, 8, 10]
16  */
17 function unary(func) {
18   return ary(func, 1);
19 }
20
21 module.exports = unary;