source: imaps-frontend/node_modules/@babel/plugin-transform-parameters/lib/index.js

main
Last change on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 1.4 KB
Line 
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;
13var _helperPluginUtils = require("@babel/helper-plugin-utils");
14var _params = require("./params.js");
15var _rest = require("./rest.js");
16var _default = exports.default = (0, _helperPluginUtils.declare)((api, options) => {
17 var _api$assumption, _api$assumption2;
18 api.assertVersion(7);
19 const ignoreFunctionLength = (_api$assumption = api.assumption("ignoreFunctionLength")) != null ? _api$assumption : options.loose;
20 const noNewArrows = (_api$assumption2 = api.assumption("noNewArrows")) != null ? _api$assumption2 : true;
21 return {
22 name: "transform-parameters",
23 visitor: {
24 Function(path) {
25 if (path.isArrowFunctionExpression() && path.get("params").some(param => param.isRestElement() || param.isAssignmentPattern())) {
26 path.arrowFunctionToExpression({
27 allowInsertArrowWithRest: false,
28 noNewArrows
29 });
30 if (!path.isFunctionExpression()) return;
31 }
32 const convertedRest = (0, _rest.default)(path);
33 const convertedParams = (0, _params.default)(path, ignoreFunctionLength);
34 if (convertedRest || convertedParams) {
35 path.scope.crawl();
36 }
37 }
38 }
39 };
40});
41
42//# sourceMappingURL=index.js.map
Note: See TracBrowser for help on using the repository browser.