Files
lodash/lodash.unary/index.js
John-David Dalton d35a9c40be Bump to v4.0.0.
2018-02-03 19:13:36 -08:00

30 lines
852 B
JavaScript

/**
* lodash 4.0.0 (Custom Build) <https://lodash.com/>
* Build: `lodash modularize exports="npm" -o ./`
* Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
* Available under MIT license <https://lodash.com/license>
*/
var ary = require('lodash.ary');
/**
* Creates a function that accepts up to one argument, ignoring any
* additional arguments.
*
* @static
* @memberOf _
* @category Function
* @param {Function} func The function to cap arguments for.
* @returns {Function} Returns the new function.
* @example
*
* _.map(['6', '8', '10'], _.unary(parseInt));
* // => [6, 8, 10]
*/
function unary(func) {
return ary(func, 1);
}
module.exports = unary;