summaryrefslogtreecommitdiff
path: root/node_modules/@babel/plugin-syntax-import-assertions/lib
diff options
context:
space:
mode:
authorlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
committerlittleblack111 <littleblack11111@gmail.com>2024-08-30 17:21:18 +0800
commitefbc2ffe6a1ee5ec38a4396305561d6515d0943e (patch)
tree2b4c94f18f2c792dfda813050755d5c0273fae22 /node_modules/@babel/plugin-syntax-import-assertions/lib
parent43acceb75957c880a5ba5a31aae221394a36d5f6 (diff)
node fixes, updates
Diffstat (limited to 'node_modules/@babel/plugin-syntax-import-assertions/lib')
-rw-r--r--node_modules/@babel/plugin-syntax-import-assertions/lib/index.js20
-rw-r--r--node_modules/@babel/plugin-syntax-import-assertions/lib/index.js.map2
2 files changed, 19 insertions, 3 deletions
diff --git a/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js b/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js
index fe508b4e..33fe93cf 100644
--- a/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js
+++ b/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js
@@ -9,8 +9,24 @@ var _default = exports.default = (0, _helperPluginUtils.declare)(api => {
api.assertVersion(7);
return {
name: "syntax-import-assertions",
- manipulateOptions(opts, parserOpts) {
- parserOpts.plugins.push("importAssertions");
+ manipulateOptions(opts, {
+ plugins
+ }) {
+ for (let i = 0; i < plugins.length; i++) {
+ const plugin = plugins[i];
+ if (plugin === "importAttributes") {
+ plugins[i] = ["importAttributes", {
+ deprecatedAssertSyntax: true
+ }];
+ return;
+ }
+ if (Array.isArray(plugin) && plugin[0] === "importAttributes") {
+ if (plugin.length < 2) plugins[i].push({});
+ plugin[1].deprecatedAssertSyntax = true;
+ return;
+ }
+ }
+ plugins.push("importAssertions");
}
};
});
diff --git a/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js.map b/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js.map
index 463e7904..24962473 100644
--- a/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js.map
+++ b/node_modules/@babel/plugin-syntax-import-assertions/lib/index.js.map
@@ -1 +1 @@
-{"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","assertVersion","name","manipulateOptions","opts","parserOpts","plugins","push"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return {\n name: \"syntax-import-assertions\",\n\n manipulateOptions(opts, parserOpts) {\n parserOpts.plugins.push(\"importAssertions\");\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,OAAO;IACLC,IAAI,EAAE,0BAA0B;IAEhCC,iBAAiBA,CAACC,IAAI,EAAEC,UAAU,EAAE;MAClCA,UAAU,CAACC,OAAO,CAACC,IAAI,CAAC,kBAAkB,CAAC;IAC7C;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]} \ No newline at end of file
+{"version":3,"names":["_helperPluginUtils","require","_default","exports","default","declare","api","assertVersion","name","manipulateOptions","opts","plugins","i","length","plugin","deprecatedAssertSyntax","Array","isArray","push"],"sources":["../src/index.ts"],"sourcesContent":["import { declare } from \"@babel/helper-plugin-utils\";\n\nexport default declare(api => {\n api.assertVersion(REQUIRED_VERSION(7));\n\n return {\n name: \"syntax-import-assertions\",\n\n manipulateOptions(opts, { plugins }) {\n for (let i = 0; i < plugins.length; i++) {\n const plugin = plugins[i];\n if (plugin === \"importAttributes\") {\n plugins[i] = [\"importAttributes\", { deprecatedAssertSyntax: true }];\n return;\n }\n if (Array.isArray(plugin) && plugin[0] === \"importAttributes\") {\n if (plugin.length < 2) (plugins[i] as any[]).push({});\n plugin[1].deprecatedAssertSyntax = true;\n return;\n }\n }\n plugins.push(\"importAssertions\");\n },\n };\n});\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEtC,IAAAC,0BAAO,EAACC,GAAG,IAAI;EAC5BA,GAAG,CAACC,aAAa,CAAkB,CAAE,CAAC;EAEtC,OAAO;IACLC,IAAI,EAAE,0BAA0B;IAEhCC,iBAAiBA,CAACC,IAAI,EAAE;MAAEC;IAAQ,CAAC,EAAE;MACnC,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,OAAO,CAACE,MAAM,EAAED,CAAC,EAAE,EAAE;QACvC,MAAME,MAAM,GAAGH,OAAO,CAACC,CAAC,CAAC;QACzB,IAAIE,MAAM,KAAK,kBAAkB,EAAE;UACjCH,OAAO,CAACC,CAAC,CAAC,GAAG,CAAC,kBAAkB,EAAE;YAAEG,sBAAsB,EAAE;UAAK,CAAC,CAAC;UACnE;QACF;QACA,IAAIC,KAAK,CAACC,OAAO,CAACH,MAAM,CAAC,IAAIA,MAAM,CAAC,CAAC,CAAC,KAAK,kBAAkB,EAAE;UAC7D,IAAIA,MAAM,CAACD,MAAM,GAAG,CAAC,EAAGF,OAAO,CAACC,CAAC,CAAC,CAAWM,IAAI,CAAC,CAAC,CAAC,CAAC;UACrDJ,MAAM,CAAC,CAAC,CAAC,CAACC,sBAAsB,GAAG,IAAI;UACvC;QACF;MACF;MACAJ,OAAO,CAACO,IAAI,CAAC,kBAAkB,CAAC;IAClC;EACF,CAAC;AACH,CAAC,CAAC","ignoreList":[]} \ No newline at end of file