lib/base.js
function inlineDiff(err, escape) {
  var msg = errorDiff(err, 'WordsWithSpace', escape);

  // linenos
  var lines = msg.split('\n');
  if (lines.length > 4) {
    var width = String(lines.length).length;
    msg = lines.map(function(str, i){
      return pad(++i, width) + ' |' + ' ' + str;
    }).join('\n');
  }

  // legend
  msg = '\n'
    + color('diff removed', 'actual')
    + ' '
    + color('diff added', 'expected')
    + '\n\n'
    + msg
    + '\n';

  // indent
  msg = msg.replace(/^/gm, '      ');
  return msg;
}
function inlineDiff(err, escape) {
  var msg = errorDiff(err, 'WordsWithSpace', escape);

  // linenos
  var lines = msg.split('\n');
  if (lines.length > 4) {
    var width = String(lines.length).length;
    msg = lines.map(function(str, i){
      return pad(++i, width) + ' |' + ' ' + str;
    }).join('\n');
  }

  // legend
  msg = '\n'
    + color('diff removed', 'actual')
    + ' '
    + color('diff added', 'expected')
    + '\n\n'
    + msg
    + '\n';

  // indent
  msg = msg.replace(/^/gm, '      ');
  return msg;
}
function inlineDiff ( err , escape ) { var msg = errorDiff ( err , 'WordsWithSpace' , escape ) ; // linenos var lines = msg . split ( '\n' ) ; if ( lines . length > 4 ) { var width = String ( lines . length ) . length ; msg = lines . map ( function ( str , i ) { return pad ( ++ i , width ) + ' |' + ' ' + str ; } ) . join ( '\n' ) ; } // legend msg = '\n' + color ( 'diff removed' , 'actual' ) + ' ' + color ( 'diff added' , 'expected' ) + '\n\n' + msg + '\n' ; // indent msg = msg . replace ( / ^ / gm , '      ' ) ; return msg ; }
Returns an inline diff between 2 strings with coloured ANSI output

@param {Error} Error with actual/expected
@return {String} Diff
@api private
Returns an inline diff between 2 strings with coloured ANSI output