function pad(input, char, count, direction) {
  var ipt = '' + (input);
  var rem = count - ipt.length;
  if (rem < 1) {
    return ipt;
  }
  var padding = char.repeat(count - ipt.length);
  return direction === 'left' ? padding + ipt : ipt + padding;
}
function pad(input, char, count, direction) {
  var ipt = '' + (input);
  var rem = count - ipt.length;
  if (rem < 1) {
    return ipt;
  }
  var padding = char.repeat(count - ipt.length);
  return direction === 'left' ? padding + ipt : ipt + padding;
}
function pad ( input , char , count , direction ) { var ipt = '' + ( input ) ; var rem = count - ipt . length ; if ( rem < 1 ) { return ipt ; } var padding = char . repeat ( count - ipt . length ) ; return direction === 'left' ? padding + ipt : ipt + padding ; }
/*
Private functions.
/ * Private functions .