index.js 784 B

1234567891011121314151617181920212223242526272829303132333435363738
  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 _pluginSyntaxNumericSeparator = require("@babel/plugin-syntax-numeric-separator");
  8. function remover({
  9. node
  10. }) {
  11. var _extra$raw;
  12. const {
  13. extra
  14. } = node;
  15. if (extra != null && (_extra$raw = extra.raw) != null && _extra$raw.includes("_")) {
  16. extra.raw = extra.raw.replace(/_/g, "");
  17. }
  18. }
  19. var _default = (0, _helperPluginUtils.declare)(api => {
  20. api.assertVersion(7);
  21. return {
  22. name: "proposal-numeric-separator",
  23. inherits: _pluginSyntaxNumericSeparator.default,
  24. visitor: {
  25. NumericLiteral: remover,
  26. BigIntLiteral: remover
  27. }
  28. };
  29. });
  30. exports.default = _default;