Bump to v4.0.0.

This commit is contained in:
John-David Dalton
2015-08-24 10:34:23 -07:00
parent 4ef16c96e5
commit 0646bacd86
665 changed files with 24828 additions and 19696 deletions

View File

@@ -1,9 +1,9 @@
var deburr = require('../string/deburr'),
words = require('../string/words');
var arrayReduce = require('./arrayReduce'),
deburr = require('../deburr'),
words = require('../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 @@ var deburr = require('../string/deburr'),
*/
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, '');
};
}