UNPKG

345 BJavaScriptView Raw
1var toString = require('../lang/toString');
2var lowerCase = require('./lowerCase');
3var upperCase = require('./upperCase');
4 /**
5 * UPPERCASE first char of each word.
6 */
7 function properCase(str){
8 str = toString(str);
9 return lowerCase(str).replace(/^\w|\s\w/g, upperCase);
10 }
11
12 module.exports = properCase;
13