1 var deburr = require('../string/deburr'),
2 words = require('../string/words');
5 * Creates a function that produces compound words out of the words in a
9 * @param {Function} callback The function to combine each word.
10 * @returns {Function} Returns the new compounder function.
12 function createCompounder(callback) {
13 return function(string) {
15 array = words(deburr(string)),
16 length = array.length,
19 while (++index < length) {
20 result = callback(result, array[index], index);
26 module.exports = createCompounder;