Bump to v4.0.0.

This commit is contained in:
John-David Dalton
2015-09-17 17:52:09 -07:00
parent 1d77dfa4b7
commit 54e7baecc3
675 changed files with 11257 additions and 8085 deletions

View File

@@ -1,9 +1,9 @@
import deburr from '../string/deburr';
import words from '../string/words';
import arrayReduce from './arrayReduce';
import deburr from '../deburr';
import words from '../words';
/**
* Creates a function that produces compound words out of the words in a
* given string.
* Creates a function like `_.camelCase`.
*
* @private
* @param {Function} callback The function to combine each word.
@@ -11,15 +11,7 @@ import words from '../string/words';
*/
function createCompounder(callback) {
return function(string) {
var index = -1,
array = words(deburr(string)),
length = array.length,
result = '';
while (++index < length) {
result = callback(result, array[index], index);
}
return result;
return arrayReduce(words(deburr(string)), callback, '');
};
}