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.
		
		
		
		
			
				
					16 lines
				
				328 B
			
		
		
			
		
	
	
					16 lines
				
				328 B
			| 
								 
											4 years ago
										 
									 | 
							
								var noCase = require('no-case')
							 | 
						||
| 
								 | 
							
								var upperCase = require('upper-case')
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Title case a string.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 * @param  {string} value
							 | 
						||
| 
								 | 
							
								 * @param  {string} [locale]
							 | 
						||
| 
								 | 
							
								 * @return {string}
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								module.exports = function (value, locale) {
							 | 
						||
| 
								 | 
							
								  return noCase(value, locale).replace(/^.| ./g, function (m) {
							 | 
						||
| 
								 | 
							
								    return upperCase(m, locale)
							 | 
						||
| 
								 | 
							
								  })
							 | 
						||
| 
								 | 
							
								}
							 |