src/Ify.js
function parseBody(fn){
  //get arguments to function as array of strings
  var body=fn.body=fn.body||      //cache result in `body` property of function
      fn.toString()               //get string version of function
      .replace(/\/\/.*$|\/\*[\s\S]*?\*\//mg, '')   //strip comments
      .replace(/^\s*$/mg, '')     // kill empty lines
      .replace(/^.*?\)\s*\{\s*(return)?\s*/, '') // kill argument list and leading curly
      .replace(/\s*\}\s*$/, '')   // kill trailing curly
  ;
  return body; // or fn?
}
function parseBody(fn){
  //get arguments to function as array of strings
  var body=fn.body=fn.body||      //cache result in `body` property of function
      fn.toString()               //get string version of function
      .replace(/\/\/.*$|\/\*[\s\S]*?\*\//mg, '')   //strip comments
      .replace(/^\s*$/mg, '')     // kill empty lines
      .replace(/^.*?\)\s*\{\s*(return)?\s*/, '') // kill argument list and leading curly
      .replace(/\s*\}\s*$/, '')   // kill trailing curly
  ;
  return body; // or fn?
}
function parseBody ( fn ) { //get arguments to function as array of strings var body = fn . body = fn . body || //cache result in `body` property of function fn . toString ( ) //get string version of function . replace ( / \/\/.*$|\/\*[\s\S]*?\*\/ / mg , '' ) //strip comments . replace ( / ^\s*$ / mg , '' ) // kill empty lines . replace ( / ^.*?\)\s*\{\s*(return)?\s* / , '' ) // kill argument list and leading curly . replace ( / \s*\}\s*$ / , '' ) // kill trailing curly ; return body ; // or fn? }
Return function body.
Return function body .