autodoc.js
function unindent(string, skipFirstLine) {
    var lines     = string.split('\n'),
        skipFirst = typeof skipFirstLine !== 'undefined' ? skipFirstLine : true,
        start     = skipFirst ? 1 : 0;

    var indentation, smallestIndentation = Infinity;
    for (var i = start, len = lines.length; i < len; ++i) {
      if (isBlank(lines[i])) {
        continue;
      }

      indentation = getIndentation(lines[i]);
      if (indentation < smallestIndentation) {
        smallestIndentation = indentation;
      }
    }

    var result = [lines[0]]
      .concat(
        lines
          .slice(1)
          .map(function(line) { return decreaseIndent(line, smallestIndentation); })
      )
      .join('\n');

    return result;
  }
function unindent(string, skipFirstLine) {
    var lines     = string.split('\n'),
        skipFirst = typeof skipFirstLine !== 'undefined' ? skipFirstLine : true,
        start     = skipFirst ? 1 : 0;

    var indentation, smallestIndentation = Infinity;
    for (var i = start, len = lines.length; i < len; ++i) {
      if (isBlank(lines[i])) {
        continue;
      }

      indentation = getIndentation(lines[i]);
      if (indentation < smallestIndentation) {
        smallestIndentation = indentation;
      }
    }

    var result = [lines[0]]
      .concat(
        lines
          .slice(1)
          .map(function(line) { return decreaseIndent(line, smallestIndentation); })
      )
      .join('\n');

    return result;
  }
function unindent ( string , skipFirstLine ) { var lines = string . split ( '\n' ) , skipFirst = typeof skipFirstLine !== 'undefined' ? skipFirstLine : true , start = skipFirst ? 1 : 0 ; var indentation , smallestIndentation = Infinity ; for ( var i = start , len = lines . length ; i < len ; ++ i ) { if ( isBlank ( lines [ i ] ) ) { continue ; } indentation = getIndentation ( lines [ i ] ) ; if ( indentation < smallestIndentation ) { smallestIndentation = indentation ; } } var result = [ lines [ 0 ] ] . concat ( lines . slice ( 1 ) . map ( function ( line ) { return decreaseIndent ( line , smallestIndentation ) ; } ) ) . join ( '\n' ) ; return result ; }
Unindents a multiline string based on the indentation level of the least-
indented line.

@private
@param {string} string The string to unindent.
@param {boolean} skipFirstLine Whether or not to skip the first line for
the purpose of determining proper indentation (defaults to `true`).
@returns {string} A new string that has effectively been unindented.

@examples
unindent('foo\n  bar\n  baz');   // => 'foo\nbar\nbaz'
unindent('foo\n  bar\n    baz'); // => 'foo\nbar\n  baz'
unindent('foo\n\n  bar\n  baz'); // => 'foo\n\nbar\nbaz'
unindent('foo\n\n  bar\n baz');  // => 'foo\n\n bar\nbaz'
Unindents a multiline string based on the indentation level of the least - indented line .