UNPKG

784 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _helperPluginUtils = require("@babel/helper-plugin-utils");
9
10var _pluginSyntaxNumericSeparator = require("@babel/plugin-syntax-numeric-separator");
11
12function remover({
13 node
14}) {
15 var _extra$raw;
16
17 const {
18 extra
19 } = node;
20
21 if (extra != null && (_extra$raw = extra.raw) != null && _extra$raw.includes("_")) {
22 extra.raw = extra.raw.replace(/_/g, "");
23 }
24}
25
26var _default = (0, _helperPluginUtils.declare)(api => {
27 api.assertVersion(7);
28 return {
29 name: "proposal-numeric-separator",
30 inherits: _pluginSyntaxNumericSeparator.default,
31 visitor: {
32 NumericLiteral: remover,
33 BigIntLiteral: remover
34 }
35 };
36});
37
38exports.default = _default;
\No newline at end of file