index.js 982 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = function () {
  4. return {
  5. visitor: {
  6. RegExpLiteral: function RegExpLiteral(_ref) {
  7. var node = _ref.node;
  8. if (!regex.is(node, "u")) return;
  9. node.pattern = (0, _regexpuCore2.default)(node.pattern, node.flags);
  10. regex.pullFlag(node, "u");
  11. }
  12. }
  13. };
  14. };
  15. var _regexpuCore = require("regexpu-core");
  16. var _regexpuCore2 = _interopRequireDefault(_regexpuCore);
  17. var _babelHelperRegex = require("babel-helper-regex");
  18. var regex = _interopRequireWildcard(_babelHelperRegex);
  19. function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
  20. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  21. module.exports = exports["default"];