lib/esprima-helpers.js
function getFirstReturnStatement(node) {
    if (!node || !node.body) {
      return;
    }
    if (node.body.type === 'BlockStatement') {
      node = node.body;
    }
    for (var i = 0; i < node.body.length; i++) {
      if (node.body[i].type === 'ReturnStatement') {
        return node.body[i];
      }
    }
  }
function getFirstReturnStatement(node) {
    if (!node || !node.body) {
      return;
    }
    if (node.body.type === 'BlockStatement') {
      node = node.body;
    }
    for (var i = 0; i < node.body.length; i++) {
      if (node.body[i].type === 'ReturnStatement') {
        return node.body[i];
      }
    }
  }
function getFirstReturnStatement ( node ) { if ( ! node || ! node . body ) { return ; } if ( node . body . type === 'BlockStatement' ) { node = node . body ; } for ( var i = 0 ; i < node . body . length ; i ++ ) { if ( node . body [ i ] . type === 'ReturnStatement' ) { return node . body [ i ] ; } } }
Pareses a FunctionExpression or BlockStatement and returns the first ReturnStatement

@param node
@returns {*}
Pareses a FunctionExpression or BlockStatement and returns the first ReturnStatement