lib/cli/util.js
function statusByColor(jenkinsColor) {

  if (jenkinsColor) {

    // Jenkins color value can contain either a color, color_anime, or status in job.color field,
    // hence to get color/status value out of the mix we need to remove the postfix _anime,
    // _anime postfix only exists on a job currently being built
    jenkinsColor = jenkinsColor.replace(/_anime$/, '');

    status = (COLOR_STATUS[jenkinsColor]) ? COLOR_STATUS[jenkinsColor][0] : jenkinsColor;
  } else {
    status = 'unknown';
  }

  return status;
}
function statusByColor(jenkinsColor) {

  if (jenkinsColor) {

    // Jenkins color value can contain either a color, color_anime, or status in job.color field,
    // hence to get color/status value out of the mix we need to remove the postfix _anime,
    // _anime postfix only exists on a job currently being built
    jenkinsColor = jenkinsColor.replace(/_anime$/, '');

    status = (COLOR_STATUS[jenkinsColor]) ? COLOR_STATUS[jenkinsColor][0] : jenkinsColor;
  } else {
    status = 'unknown';
  }

  return status;
}
function statusByColor ( jenkinsColor ) { if ( jenkinsColor ) { // Jenkins color value can contain either a color, color_anime, or status in job.color field, // hence to get color/status value out of the mix we need to remove the postfix _anime, // _anime postfix only exists on a job currently being built jenkinsColor = jenkinsColor . replace ( / _anime$ / , '' ) ; status = ( COLOR_STATUS [ jenkinsColor ] ) ? COLOR_STATUS [ jenkinsColor ] [ 0 ] : jenkinsColor ; } else { status = 'unknown' ; } return status ; }
Get status based on the value of color property.

Color property can contain either color or status text.
Hence the need for mapping color to status text in the case where value is really color.
This is used in conjunction with colorByStatus function.

@param {String} jenkinsColor: Jenkins status color
@return the status text
Get status based on the value of color property .