mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Use _.startCase.
This commit is contained in:
@@ -214,18 +214,7 @@ if (tunneled) {
|
|||||||
* @returns {string} Returns the formal browser name.
|
* @returns {string} Returns the formal browser name.
|
||||||
*/
|
*/
|
||||||
function browserName(identifier) {
|
function browserName(identifier) {
|
||||||
return browserNameMap[identifier] || capitalizeWords(identifier);
|
return browserNameMap[identifier] || _.startCase(identifier);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Capitalizes the first character of each word in `string`.
|
|
||||||
*
|
|
||||||
* @private
|
|
||||||
* @param {string} string The string to augment.
|
|
||||||
* @returns {string} Returns the augmented string.
|
|
||||||
*/
|
|
||||||
function capitalizeWords(string) {
|
|
||||||
return _.map(string.split(' '), _.capitalize).join(' ');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -451,7 +440,7 @@ function onJobStatus(error, res, body) {
|
|||||||
this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
|
this._pollerId = _.delay(_.bind(this.status, this), this.statusInterval * 1000);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
|
var description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
|
||||||
errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
|
errored = !jobResult || !jobResult.passed || reError.test(message) || reError.test(jobStatus),
|
||||||
failures = _.result(jobResult, 'failed'),
|
failures = _.result(jobResult, 'failed'),
|
||||||
label = options.name + ':',
|
label = options.name + ':',
|
||||||
@@ -602,7 +591,7 @@ Job.prototype.restart = function(callback) {
|
|||||||
|
|
||||||
var options = this.options,
|
var options = this.options,
|
||||||
platform = options.platforms[0],
|
platform = options.platforms[0],
|
||||||
description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + capitalizeWords(platform[0]),
|
description = browserName(platform[1]) + ' ' + platform[2] + ' on ' + _.startCase(platform[0]),
|
||||||
label = options.name + ':';
|
label = options.name + ':';
|
||||||
|
|
||||||
logInline();
|
logInline();
|
||||||
|
|||||||
Reference in New Issue
Block a user