You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
497 B

4 years ago
  1. var baseInverter = require('./_baseInverter');
  2. /**
  3. * Creates a function like `_.invertBy`.
  4. *
  5. * @private
  6. * @param {Function} setter The function to set accumulator values.
  7. * @param {Function} toIteratee The function to resolve iteratees.
  8. * @returns {Function} Returns the new inverter function.
  9. */
  10. function createInverter(setter, toIteratee) {
  11. return function(object, iteratee) {
  12. return baseInverter(object, setter, toIteratee(iteratee), {});
  13. };
  14. }
  15. module.exports = createInverter;