Last change
on this file since bdd6491 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago |
primeNG components
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | Object.defineProperty(exports, "convertFunctionParams", {
|
---|
7 | enumerable: true,
|
---|
8 | get: function () {
|
---|
9 | return _params.default;
|
---|
10 | }
|
---|
11 | });
|
---|
12 | exports.default = void 0;
|
---|
13 |
|
---|
14 | var _helperPluginUtils = require("@babel/helper-plugin-utils");
|
---|
15 |
|
---|
16 | var _params = require("./params");
|
---|
17 |
|
---|
18 | var _rest = require("./rest");
|
---|
19 |
|
---|
20 | var _default = (0, _helperPluginUtils.declare)((api, options) => {
|
---|
21 | var _api$assumption;
|
---|
22 |
|
---|
23 | api.assertVersion(7);
|
---|
24 | const ignoreFunctionLength = (_api$assumption = api.assumption("ignoreFunctionLength")) != null ? _api$assumption : options.loose;
|
---|
25 | const noNewArrows = api.assumption("noNewArrows");
|
---|
26 | return {
|
---|
27 | name: "transform-parameters",
|
---|
28 | visitor: {
|
---|
29 | Function(path) {
|
---|
30 | if (path.isArrowFunctionExpression() && path.get("params").some(param => param.isRestElement() || param.isAssignmentPattern())) {
|
---|
31 | path.arrowFunctionToExpression({
|
---|
32 | noNewArrows
|
---|
33 | });
|
---|
34 | if (!path.isFunctionExpression()) return;
|
---|
35 | }
|
---|
36 |
|
---|
37 | const convertedRest = (0, _rest.default)(path);
|
---|
38 | const convertedParams = (0, _params.default)(path, ignoreFunctionLength);
|
---|
39 |
|
---|
40 | if (convertedRest || convertedParams) {
|
---|
41 | path.scope.crawl();
|
---|
42 | }
|
---|
43 | }
|
---|
44 |
|
---|
45 | }
|
---|
46 | };
|
---|
47 | });
|
---|
48 |
|
---|
49 | exports.default = _default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.