index.js 780 B

12345678910111213141516171819202122232425262728293031
  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. function remover({
  8. node
  9. }) {
  10. var _extra$raw;
  11. const {
  12. extra
  13. } = node;
  14. if (extra != null && (_extra$raw = extra.raw) != null && _extra$raw.includes("_")) {
  15. extra.raw = extra.raw.replace(/_/g, "");
  16. }
  17. }
  18. var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
  19. api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta");
  20. return {
  21. name: "transform-numeric-separator",
  22. manipulateOptions: (_, parser) => parser.plugins.push("numericSeparator"),
  23. visitor: {
  24. NumericLiteral: remover,
  25. BigIntLiteral: remover
  26. }
  27. };
  28. });
  29. //# sourceMappingURL=index.js.map