mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Bump to v3.0.0.
This commit is contained in:
29
lodash.capitalize/index.js
Normal file
29
lodash.capitalize/index.js
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* lodash 3.0.0 (Custom Build) <https://lodash.com/>
|
||||
* Build: `lodash modern modularize exports="npm" -o ./`
|
||||
* Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.7.0 <http://underscorejs.org/LICENSE>
|
||||
* Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
* Available under MIT license <https://lodash.com/license>
|
||||
*/
|
||||
var baseToString = require('lodash._basetostring');
|
||||
|
||||
/**
|
||||
* Capitalizes the first character of `string`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to capitalize.
|
||||
* @returns {string} Returns the capitalized string.
|
||||
* @example
|
||||
*
|
||||
* _.capitalize('fred');
|
||||
* // => 'Fred'
|
||||
*/
|
||||
function capitalize(string) {
|
||||
string = baseToString(string);
|
||||
return string && (string.charAt(0).toUpperCase() + string.slice(1));
|
||||
}
|
||||
|
||||
module.exports = capitalize;
|
||||
Reference in New Issue
Block a user