1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
9 |
|
10 | var _pluginSyntaxDecorators = require("@babel/plugin-syntax-decorators");
|
11 |
|
12 | var _helperCreateClassFeaturesPlugin = require("@babel/helper-create-class-features-plugin");
|
13 |
|
14 | var _transformerLegacy = require("./transformer-legacy");
|
15 |
|
16 | var _transformer = require("./transformer-2021-12");
|
17 |
|
18 | var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
19 | api.assertVersion(7);
|
20 | {
|
21 | var {
|
22 | legacy
|
23 | } = options;
|
24 | }
|
25 | const {
|
26 | version
|
27 | } = options;
|
28 |
|
29 | if (legacy || version === "legacy") {
|
30 | return {
|
31 | name: "proposal-decorators",
|
32 | inherits: _pluginSyntaxDecorators.default,
|
33 | visitor: _transformerLegacy.default
|
34 | };
|
35 | } else if (version === "2021-12") {
|
36 | return (0, _transformer.default)(api, options);
|
37 | } else {
|
38 | return (0, _helperCreateClassFeaturesPlugin.createClassFeaturePlugin)({
|
39 | name: "proposal-decorators",
|
40 | api,
|
41 | feature: _helperCreateClassFeaturesPlugin.FEATURES.decorators,
|
42 | inherits: _pluginSyntaxDecorators.default
|
43 | });
|
44 | }
|
45 | });
|
46 |
|
47 | exports.default = _default; |
\ | No newline at end of file |