<commit_before>module.exports = babelPluginTransformReactEs6ClassDisplayName;

function babelPluginTransformReactEs6ClassDisplayName (babel) {
  var t = babel.types.t;
  return {
    visitor: {
      ClassDeclaration: function (path) {
        addDisplayName.call(path, t);
      }
    }
  };
}

function addDisplayName (t) {
  if (this.node.superClass.property.name === 'Component') {
    this.insertAfter([
      t.expressionStatement(t.assignmentExpression(
        '=',
        t.memberExpression(this.node.id, t.identifier('displayName')),
        t.stringLiteral(this.node.id.name)
      ))
    ]);
  }
}<commit_msg>Fix types access<commit_after>module.exports = babelPluginTransformReactEs6ClassDisplayName;

function babelPluginTransformReactEs6ClassDisplayName (babel) {
  return {
    visitor: {
      ClassDeclaration: function (path) {
        addDisplayName.call(path, babel.types);
      }
    }
  };
}

function addDisplayName (t) {
  if (this.node.superClass.property.name === 'Component') {
    this.insertAfter([
      t.expressionStatement(t.assignmentExpression(
        '=',
        t.memberExpression(this.node.id, t.identifier('displayName')),
        t.stringLiteral(this.node.id.name)
      ))
    ]);
  }
}
{'fraction_non_alphanumeric': 0.12905844155844157, 'fraction_numerical': 0.003246753246753247, 'mean_word_length': 3.28125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7399586', 'n_tokens_mistral': 386, 'n_tokens_neox': 386, 'n_words': 51}