477cdb8f097df129ebe0f6556d8790a249e0a91f6cac997077961ec1e264d0a295ff23395179a048837bfeab594841f7f430b6bd9af83e27404d4d56d572e7 633 B

123456789101112131415161718192021222324
  1. import arrayReduce from './_arrayReduce.js';
  2. import deburr from './deburr.js';
  3. import words from './words.js';
  4. /** Used to compose unicode capture groups. */
  5. var rsApos = "['\u2019]";
  6. /** Used to match apostrophes. */
  7. var reApos = RegExp(rsApos, 'g');
  8. /**
  9. * Creates a function like `_.camelCase`.
  10. *
  11. * @private
  12. * @param {Function} callback The function to combine each word.
  13. * @returns {Function} Returns the new compounder function.
  14. */
  15. function createCompounder(callback) {
  16. return function(string) {
  17. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  18. };
  19. }
  20. export default createCompounder;