mirror of https://github.com/MingweiSamuel/Riven
16 lines
328 B
JavaScript
16 lines
328 B
JavaScript
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)
|
|
})
|
|
}
|