ember-introjs
Version:
An Ember Component for intro.js
17 lines (13 loc) • 363 B
JavaScript
;
module.exports = function(str) {
if (typeof str !== 'string') { return; }
// Special case for PhantomJS
if (str.toLowerCase() === 'phantomjs') {
return 'PhantomJS';
}
return str.replace(/\w+/g, function(word) {
return word.replace(/^[a-z]/, function(firstCharacter) {
return firstCharacter.toUpperCase();
});
});
};