source: imaps-frontend/node_modules/lodash-es/unary.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 467 bytes
RevLine 
[d565449]1import ary from './ary.js';
2
3/**
4 * Creates a function that accepts up to one argument, ignoring any
5 * additional arguments.
6 *
7 * @static
8 * @memberOf _
9 * @since 4.0.0
10 * @category Function
11 * @param {Function} func The function to cap arguments for.
12 * @returns {Function} Returns the new capped function.
13 * @example
14 *
15 * _.map(['6', '8', '10'], _.unary(parseInt));
16 * // => [6, 8, 10]
17 */
18function unary(func) {
19 return ary(func, 1);
20}
21
22export default unary;
Note: See TracBrowser for help on using the repository browser.