5d9ef1c979e9ad62f3244c4259d78d893f05beee53c7fefc6f40d0b9a4b9af5ee3432846adecbe557913d0f9c24fa4c722c1b782ed9271e41bf0aea3aea1a5 634 B

12345678910111213141516171819202122232425262728
  1. import createWrap from './_createWrap.js';
  2. /** Used to compose bitmasks for function metadata. */
  3. var WRAP_FLIP_FLAG = 512;
  4. /**
  5. * Creates a function that invokes `func` with arguments reversed.
  6. *
  7. * @static
  8. * @memberOf _
  9. * @since 4.0.0
  10. * @category Function
  11. * @param {Function} func The function to flip arguments for.
  12. * @returns {Function} Returns the new flipped function.
  13. * @example
  14. *
  15. * var flipped = _.flip(function() {
  16. * return _.toArray(arguments);
  17. * });
  18. *
  19. * flipped('a', 'b', 'c', 'd');
  20. * // => ['d', 'c', 'b', 'a']
  21. */
  22. function flip(func) {
  23. return createWrap(func, WRAP_FLIP_FLAG);
  24. }
  25. export default flip;