var esprima = require("esprima");

var Syntax = esprima.Syntax;

/**
 * Transform `_reactGlobalize.<fn>` (commonly generated by babel when transpiling ES6) into
 * `ReactGlobalize.<fn>`.
 */
module.exports = {
  test: function(node) {
    return node.type === Syntax.MemberExpression &&
      node.object.type === Syntax.Identifier &&
      node.object.name === "_reactGlobalize";
  },

  transform: function(node) {
    node.object.name = "ReactGlobalize";
  }
};
