lib/report.js
function divider(dimensions, type) {
  let left = BORDER_RUD;
  let right = BORDER_LUD;
  let line = BORDER_HORZ;
  let joint = BORDER_LRUD;

  switch (type) {
    case 'top':
      left = BORDER_RD;
      right = BORDER_LD;
      joint = BORDER_LRD;
      break;

    case 'bottom':
      left = BORDER_RU;
      right = BORDER_LU;
      joint = BORDER_LRU;
      break;

    case 'header':
      left = BORDER_UD_DBL_R;
      right = BORDER_UD_DBL_L;
      line = BORDER_DBL_HORZ;
      joint = BORDER_UD_DBL_LR;
      break;

    default: break;
  }

  const {
    name,
    avg,
    min,
    max,
  } = dimensions;

  return left
    + line.repeat(name)
    + joint
    + line.repeat(avg)
    + joint
    + line.repeat(min)
    + joint
    + line.repeat(max)
    + right
    + '\n';
}
function divider(dimensions, type) {
  let left = BORDER_RUD;
  let right = BORDER_LUD;
  let line = BORDER_HORZ;
  let joint = BORDER_LRUD;

  switch (type) {
    case 'top':
      left = BORDER_RD;
      right = BORDER_LD;
      joint = BORDER_LRD;
      break;

    case 'bottom':
      left = BORDER_RU;
      right = BORDER_LU;
      joint = BORDER_LRU;
      break;

    case 'header':
      left = BORDER_UD_DBL_R;
      right = BORDER_UD_DBL_L;
      line = BORDER_DBL_HORZ;
      joint = BORDER_UD_DBL_LR;
      break;

    default: break;
  }

  const {
    name,
    avg,
    min,
    max,
  } = dimensions;

  return left
    + line.repeat(name)
    + joint
    + line.repeat(avg)
    + joint
    + line.repeat(min)
    + joint
    + line.repeat(max)
    + right
    + '\n';
}
function divider ( dimensions , type ) { let left = BORDER_RUD ; let right = BORDER_LUD ; let line = BORDER_HORZ ; let joint = BORDER_LRUD ; switch ( type ) { case 'top' : left = BORDER_RD ; right = BORDER_LD ; joint = BORDER_LRD ; break ; case 'bottom' : left = BORDER_RU ; right = BORDER_LU ; joint = BORDER_LRU ; break ; case 'header' : left = BORDER_UD_DBL_R ; right = BORDER_UD_DBL_L ; line = BORDER_DBL_HORZ ; joint = BORDER_UD_DBL_LR ; break ; default : break ; } const { name , avg , min , max , } = dimensions ; return left + line . repeat ( name ) + joint + line . repeat ( avg ) + joint + line . repeat ( min ) + joint + line . repeat ( max ) + right + '\n' ; }
Creates a row divider for the given dimensions of a specific type.

@param {Dimensions} dimensions
@param {('top'|'bottom'|'header'|'row')} type

@returns {string}
Creates a row divider for the given dimensions of a specific type .