You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
673 B

4 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _helperPluginUtils = require("@babel/helper-plugin-utils");
  7. var _default = (0, _helperPluginUtils.declare)(api => {
  8. api.assertVersion(7);
  9. return {
  10. name: "transform-literals",
  11. visitor: {
  12. NumericLiteral({
  13. node
  14. }) {
  15. if (node.extra && /^0[ob]/i.test(node.extra.raw)) {
  16. node.extra = undefined;
  17. }
  18. },
  19. StringLiteral({
  20. node
  21. }) {
  22. if (node.extra && /\\[u]/gi.test(node.extra.raw)) {
  23. node.extra = undefined;
  24. }
  25. }
  26. }
  27. };
  28. });
  29. exports.default = _default;