1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | function _helperPluginUtils() {
|
9 | const data = require("@babel/helper-plugin-utils");
|
10 |
|
11 | _helperPluginUtils = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | function _core() {
|
19 | const data = require("@babel/core");
|
20 |
|
21 | _core = function () {
|
22 | return data;
|
23 | };
|
24 |
|
25 | return data;
|
26 | }
|
27 |
|
28 | var _default = (0, _helperPluginUtils().declare)(api => {
|
29 | api.assertVersion(7);
|
30 | return {
|
31 | name: "transform-member-expression-literals",
|
32 | visitor: {
|
33 | MemberExpression: {
|
34 | exit({
|
35 | node
|
36 | }) {
|
37 | const prop = node.property;
|
38 |
|
39 | if (!node.computed && _core().types.isIdentifier(prop) && !_core().types.isValidES3Identifier(prop.name)) {
|
40 | node.property = _core().types.stringLiteral(prop.name);
|
41 | node.computed = true;
|
42 | }
|
43 | }
|
44 |
|
45 | }
|
46 | }
|
47 | };
|
48 | });
|
49 |
|
50 | exports.default = _default; |
\ | No newline at end of file |