bin/inlineDocs.js
function extractComments (contents) {
  let context = 'idle'
  const lines = []
  contents.split('\n').forEach((line) => {
    if (line.trim() === '/**') {
      context = 'in'
      return
    }

    if (line.trim() === '*/') {
      context = 'out'
      return
    }

    if (context === 'in') {
      lines.push(line.replace(/\*/g, '').replace(/^\s\s/, ''))
    }
  })
  return lines.join('\n')
}
function extractComments (contents) {
  let context = 'idle'
  const lines = []
  contents.split('\n').forEach((line) => {
    if (line.trim() === '/**') {
      context = 'in'
      return
    }

    if (line.trim() === '*/') {
      context = 'out'
      return
    }

    if (context === 'in') {
      lines.push(line.replace(/\*/g, '').replace(/^\s\s/, ''))
    }
  })
  return lines.join('\n')
}
function extractComments ( contents ) { let context = 'idle' const lines = [ ] contents . split ( '\n' ) . forEach ( ( line ) => { if ( line . trim ( ) === '/**' ) { context = 'in' return } if ( line . trim ( ) === '*/' ) { context = 'out' return } if ( context === 'in' ) { lines . push ( line . replace ( / \* / g , '' ) . replace ( / ^\s\s / , '' ) ) } } ) return lines . join ( '\n' ) }
Extract comments from the top of the file. Also this method
assumes, each block of content has only one top of comments
section.

@method extractComments

@param  {String}        contents

@return {String}
Extract comments from the top of the file . Also this method assumes each block of content has only one top of comments section .