* Creates a function that produces compound words out of the words in a * given string. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function.
(callback)
| 4697 | * @returns {Function} Returns the new compounder function. |
| 4698 | */ |
| 4699 | function createCompounder(callback) { |
| 4700 | return function(string) { |
| 4701 | var index = -1, |
| 4702 | array = words(deburr(string)), |
| 4703 | length = array.length, |
| 4704 | result = ''; |
| 4705 | |
| 4706 | while (++index < length) { |
| 4707 | result = callback(result, array[index], index); |
| 4708 | } |
| 4709 | return result; |
| 4710 | }; |
| 4711 | } |
| 4712 | |
| 4713 | /** |
| 4714 | * Creates a function that produces an instance of `Ctor` regardless of |
no test coverage detected