Urara-Blog/node_modules/.pnpm-store/v3/files/9b/9d48df2b9cc3734bdaabdca0f94fe496f33f4761f41af586077d66820555037350ea4bfbb667d0f5e1dd28b0d663623acb7a530c4e4c3ace70f4b78c676155
2022-08-14 01:14:53 +08:00

28 lines
636 B
Text

var createWrap = require('./_createWrap');
/** Used to compose bitmasks for function metadata. */
var WRAP_FLIP_FLAG = 512;
/**
* Creates a function that invokes `func` with arguments reversed.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Function
* @param {Function} func The function to flip arguments for.
* @returns {Function} Returns the new flipped function.
* @example
*
* var flipped = _.flip(function() {
* return _.toArray(arguments);
* });
*
* flipped('a', 'b', 'c', 'd');
* // => ['d', 'c', 'b', 'a']
*/
function flip(func) {
return createWrap(func, WRAP_FLIP_FLAG);
}
module.exports = flip;