You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					18 lines
				
				304 B
			
		
		
			
		
	
	
					18 lines
				
				304 B
			| 
								 
											4 years ago
										 
									 | 
							
								var upperCase = require('upper-case')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Upper case the first character of a string.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * @param  {String} str
							 | 
						||
| 
								 | 
							
								 * @return {String}
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								module.exports = function (str, locale) {
							 | 
						||
| 
								 | 
							
								  if (str == null) {
							 | 
						||
| 
								 | 
							
								    return ''
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  str = String(str)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return upperCase(str.charAt(0), locale) + str.substr(1)
							 | 
						||
| 
								 | 
							
								}
							 |