packages/regenerator-transform/src/visit.js
function shouldRegenerate(node, state) {
  if (node.generator) {
    if (node.async) {
      // Async generator
      return state.opts.asyncGenerators !== false;
    } else {
      // Plain generator
      return state.opts.generators !== false;
    }
  } else if (node.async) {
    // Async function
    return state.opts.async !== false;
  } else {
    // Not a generator or async function.
    return false;
  }
}
function shouldRegenerate(node, state) {
  if (node.generator) {
    if (node.async) {
      // Async generator
      return state.opts.asyncGenerators !== false;
    } else {
      // Plain generator
      return state.opts.generators !== false;
    }
  } else if (node.async) {
    // Async function
    return state.opts.async !== false;
  } else {
    // Not a generator or async function.
    return false;
  }
}
function shouldRegenerate ( node , state ) { if ( node . generator ) { if ( node . async ) { // Async generator return state . opts . asyncGenerators !== false ; } else { // Plain generator return state . opts . generators !== false ; } } else if ( node . async ) { // Async function return state . opts . async !== false ; } else { // Not a generator or async function. return false ; } }
Check if a node should be transformed by regenerator
Check if a node should be transformed by regenerator