| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 1 1 1 | define(['./lowerCase', './upperCase'], function(lowerCase, upperCase){
/**
* UPPERCASE first char of each word.
* - ported from Miller Medeiros Eclipse Monkey Scripts
* @example properCase('loRem iPSum') -> 'Lorem Ipsum'
* @param {string} str
* @return {string}
* @version 0.1.0 (2011/07/20)
*/
function properCase(str){
return lowerCase(str).replace(/^\w|\s\w/g, upperCase); //replace first char of each word to UPPERCASE
}
return properCase;
});
|