Innovenergy_trunk/frontend/node_modules/@babel/plugin-transform-parameters/lib/index.js.map

1 line
3.0 KiB
Plaintext
Raw Permalink Normal View History

{"version":3,"names":["declare","api","options","assertVersion","ignoreFunctionLength","assumption","loose","noNewArrows","name","visitor","Function","path","isArrowFunctionExpression","get","some","param","isRestElement","isAssignmentPattern","arrowFunctionToExpression","allowInsertArrowWithRest","isFunctionExpression","convertedRest","convertFunctionRest","convertedParams","convertFunctionParams","scope","crawl"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\nimport convertFunctionParams from \"./params\";\nimport convertFunctionRest from \"./rest\";\nexport { convertFunctionParams };\n\nexport interface Options {\n loose?: boolean;\n}\n\nexport default declare((api, options: Options) => {\n api.assertVersion(7);\n\n const ignoreFunctionLength =\n api.assumption(\"ignoreFunctionLength\") ?? options.loose;\n // Todo(BABEL 8): Consider default it to false\n const noNewArrows = api.assumption(\"noNewArrows\") ?? true;\n\n return {\n name: \"transform-parameters\",\n\n visitor: {\n Function(path) {\n if (\n path.isArrowFunctionExpression() &&\n path\n .get(\"params\")\n .some(param => param.isRestElement() || param.isAssignmentPattern())\n ) {\n // default/rest visitors require access to `arguments`, so it cannot be an arrow\n path.arrowFunctionToExpression({\n allowInsertArrowWithRest: false,\n noNewArrows,\n });\n\n // In some cases arrowFunctionToExpression replaces the function with a wrapper.\n // Return early; the wrapped function will be visited later in the AST traversal.\n if (!path.isFunctionExpression()) return;\n }\n\n const convertedRest = convertFunctionRest(path);\n const convertedParams = convertFunctionParams(\n path,\n ignoreFunctionLength,\n );\n\n if (convertedRest || convertedParams) {\n // Manually reprocess this scope to ensure that the moved params are updated.\n path.scope.crawl();\n }\n },\n },\n };\n});\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;AACA;AAAyC,eAO1B,IAAAA,0BAAO,EAAC,CAACC,GAAG,EAAEC,OAAgB,KAAK;EAAA;EAChDD,GAAG,CAACE,aAAa,CAAC,CAAC,CAAC;EAEpB,MAAMC,oBAAoB,sBACxBH,GAAG,CAACI,UAAU,CAAC,sBAAsB,CAAC,8BAAIH,OAAO,CAACI,KAAK;EAEzD,MAAMC,WAAW,uBAAGN,GAAG,CAACI,UAAU,CAAC,aAAa,CAAC,+BAAI,IAAI;EAEzD,OAAO;IACLG,IAAI,EAAE,sBAAsB;IAE5BC,OAAO,EAAE;MACPC,QAAQ,CAACC,IAAI,EAAE;QACb,IACEA,IAAI,CAACC,yBAAyB,EAAE,IAChCD,IAAI,CACDE,GAAG,CAAC,QAAQ,CAAC,CACbC,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACC,aAAa,EAAE,IAAID,KAAK,CAACE,mBAAmB,EAAE,CAAC,EACtE;UAEAN,IAAI,CAACO,yBAAyB,CAAC;YAC7BC,wBAAwB,EAAE,KAAK;YAC/BZ;UACF,CAAC,CAAC;;UAIF,IAAI,CAACI,IAAI,CAACS,oBAAoB,EAAE,EAAE;QACpC;QAEA,MAAMC,aAAa,GAAG,IAAAC,aAAmB,EAACX,IAAI,CAAC;QAC/C,MAAMY,eAAe,GAAG,IAAAC,eAAqB,EAC3Cb,IAAI,EACJP,oBAAoB,CACrB;QAED,IAAIiB,aAAa,IAAIE,eAAe,EAAE;UAEpCZ,IAAI,CAACc,KAAK,CAACC,KAAK,EAAE;QACpB;MACF;IACF;EACF,CAAC;AACH,CAAC,CAAC;AAAA"}