6e14896fa8395e221ce81f0d680656be13e401fb
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / flip.js
1 var createWrapper = require('./_createWrapper');
2
3 /** Used to compose bitmasks for wrapper metadata. */
4 var FLIP_FLAG = 512;
5
6 /**
7  * Creates a function that invokes `func` with arguments reversed.
8  *
9  * @static
10  * @memberOf _
11  * @category Function
12  * @param {Function} func The function to flip arguments for.
13  * @returns {Function} Returns the new function.
14  * @example
15  *
16  * var flipped = _.flip(function() {
17  *   return _.toArray(arguments);
18  * });
19  *
20  * flipped('a', 'b', 'c', 'd');
21  * // => ['d', 'c', 'b', 'a']
22  */
23 function flip(func) {
24   return createWrapper(func, FLIP_FLAG);
25 }
26
27 module.exports = flip;