docs: function babel7toBabel6(ast) {
    const visitor = {
      ArrowFunctionExpression: node => {
        node.expression = node.body.type !== 'BlockStatement';
      },
      ExistsTypeAnnotation: node => {
        node.type = 'ExistentialTypeParam';
      },
      NumberLiteralTypeAnnotation: node => {
        node.type = 'NumericLiteralTypeAnnotation';
      },
      ObjectTypeIndexer: node => {
        node.end++;
        node.loc.end.column++;
      },
      ForOfStatement: node => {
        node.type = 'ForAwaitStatement';
        delete node.await;
      },
      SpreadElement: (node, path) => {
        if (
          path.parentPath.isObjectExpression() ||
          path.parentPath.isArrayExpression()
        ) {
          node.type = 'SpreadProperty';
        }
      },
      RestElement: (node, path) => {
        if (
          path.parentPath.isObjectPattern() ||
          path.parentPath.isArrayPattern()
        ) {
          node.type = 'RestProperty';
        }
      }
    };
  
    traverse(ast, {
      enter(path) {
        if (path.node.variance && path.node.variance.type === 'Variance') {
          path.node.variance = path.node.variance.kind;
        }
  
        let visitorFunc = visitor[path.node.type];
        if (visitorFunc) {
          visitorFunc(path.node, path);
        }
      }
    });
  
    return ast;
  }