You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
2.7 KiB
1 line
2.7 KiB
2 months ago
|
{"version":3,"names":["_helperCompilationTargets","require","_plugins","logPlugin","item","targetVersions","list","filteredList","getInclusionReasons","support","startsWith","proposalName","slice","hasOwnProperty","call","compatData","console","log","formattedTargets","first","target","Object","keys","exports"],"sources":["../src/debug.ts"],"sourcesContent":["import {\n getInclusionReasons,\n type Targets,\n type Target,\n} from \"@babel/helper-compilation-targets\";\nimport compatData from \"@babel/compat-data/plugins\";\n\n// Outputs a message that shows which target(s) caused an item to be included:\n// transform-foo { \"edge\":\"13\", \"firefox\":\"49\", \"ie\":\"10\" }\nexport const logPlugin = (\n item: string,\n targetVersions: Targets,\n list: { [key: string]: Targets },\n) => {\n const filteredList = getInclusionReasons(item, targetVersions, list);\n\n const support = list[item];\n\n if (!process.env.BABEL_8_BREAKING) {\n // It's needed to keep outputting proposal- in the debug log.\n if (item.startsWith(\"transform-\")) {\n const proposalName = `proposal-${item.slice(10)}`;\n if (\n proposalName === \"proposal-dynamic-import\" ||\n Object.hasOwn(compatData, proposalName)\n ) {\n item = proposalName;\n }\n }\n }\n\n if (!support) {\n console.log(` ${item}`);\n return;\n }\n\n let formattedTargets = `{`;\n let first = true;\n for (const target of Object.keys(filteredList) as Target[]) {\n if (!first) formattedTargets += `,`;\n first = false;\n formattedTargets += ` ${target}`;\n if (support[target]) formattedTargets += ` < ${support[target]}`;\n }\n formattedTargets += ` }`;\n\n console.log(` ${item} ${formattedTargets}`);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,yBAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAIO,MAAME,SAAS,GAAGA,CACvBC,IAAY,EACZC,cAAuB,EACvBC,IAAgC,KAC7B;EACH,MAAMC,YAAY,GAAG,IAAAC,6CAAmB,EAACJ,IAAI,EAAEC,cAAc,EAAEC,IAAI,CAAC;EAEpE,MAAMG,OAAO,GAAGH,I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