4daec0354c19414f513b797e6782d6fac18fc853
[yaffs-website] / node_modules / uncss / node_modules / lodash / capitalize.js
1 var toString = require('./toString'),
2     upperFirst = require('./upperFirst');
3
4 /**
5  * Converts the first character of `string` to upper case and the remaining
6  * to lower case.
7  *
8  * @static
9  * @memberOf _
10  * @category String
11  * @param {string} [string=''] The string to capitalize.
12  * @returns {string} Returns the capitalized string.
13  * @example
14  *
15  * _.capitalize('FRED');
16  * // => 'Fred'
17  */
18 function capitalize(string) {
19   return upperFirst(toString(string).toLowerCase());
20 }
21
22 module.exports = capitalize;