source: trip-planner-front/node_modules/@babel/plugin-transform-parameters/lib/index.js

Last change on this file was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 1.3 KB
RevLine 
[6a3a178]1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6Object.defineProperty(exports, "convertFunctionParams", {
7 enumerable: true,
8 get: function () {
9 return _params.default;
10 }
11});
12exports.default = void 0;
13
14var _helperPluginUtils = require("@babel/helper-plugin-utils");
15
16var _params = require("./params");
17
18var _rest = require("./rest");
19
20var _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 });
[e29cc2e]34 if (!path.isFunctionExpression()) return;
[6a3a178]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
49exports.default = _default;
Note: See TracBrowser for help on using the repository browser.