autodoc.js
function firstLine(string) {
    var lineBreak = string.indexOf('\n');

    if (lineBreak === -1) {
      return string;
    }

    return string.substring(0, lineBreak) + ' (...)';
  }
function firstLine(string) {
    var lineBreak = string.indexOf('\n');

    if (lineBreak === -1) {
      return string;
    }

    return string.substring(0, lineBreak) + ' (...)';
  }
function firstLine ( string ) { var lineBreak = string . indexOf ( '\n' ) ; if ( lineBreak === - 1 ) { return string ; } return string . substring ( 0 , lineBreak ) + ' (...)' ; }
Takes the first line of a string and, if there's more, appends '...' to
indicate as much.

@private
@param {string} string The string whose first line you want to get.
@returns {string} The first line of the string.

@examples
firstLine('foo');      // => 'foo'
firstLine('foo\nbar'); // => 'foo (...)'
Takes the first line of a string and if there s more appends ... to indicate as much .