Debian Codegraph @

packages/babel-preset-env/src/debug.ts

raw symbols SCIP
1 import {
2 getInclusionReasonsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`debug.ts`/getInclusionReasons().,
3 type Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets#,
4 type Targetscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Target#,
5 } from "@babel/helper-compilation-targets"scip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`index.ts`/;
6 import compatDatascip-typescript npm @babel/compat-data 7.20.14 data/`plugins.json`/ from "@babel/compat-data/plugins"scip-typescript npm @babel/compat-data 7.20.14 data/`plugins.json`/;
7
8 // Outputs a message that shows which target(s) caused an item to be included:
9 // transform-foo { "edge":"13", "firefox":"49", "ie":"10" }
10 export const logPluginscip-typescript npm @babel/preset-env 7.20.2 src/`debug.ts`/logPlugin. = (
11 item: string,
12 targetVersions: Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets#,
13 list: { [key: string]: Targetsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Targets# },
14 ) => {
15 const filteredList = getInclusionReasonsscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`debug.ts`/getInclusionReasons().(item, targetVersions, list);
16
17 const support = list[item];
18
19 // TODO(Babel 8): Remove this. It's needed to keep outputting proposal-
20 // in the debug log.
21 if (item.startsWithscip-typescript npm typescript 5.9.3 lib/`lib.es2015.core.d.ts`/String#startsWith().("transform-")) {
22 const proposalName = `proposal-${item.slicescip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/String#slice().(10)}`;
23 if (
24 proposalName === "proposal-dynamic-import" ||
25 Objectscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Object#.prototypescip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/ObjectConstructor#prototype..hasOwnPropertyscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Object#hasOwnProperty()..callscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/CallableFunction#call().(compatDatascip-typescript npm @babel/compat-data 7.20.14 data/`plugins.json`/, proposalName)
26 ) {
27 item = proposalName;
28 }
29 }
30
31 if (!support) {
32 consolescip-typescript npm typescript 5.9.3 lib/`lib.dom.d.ts`/console..logscip-typescript npm typescript 5.9.3 lib/`lib.dom.d.ts`/Console#log().(` ${item}`);
33 return;
34 }
35
36 let formattedTargets = `{`;
37 let first = true;
38 for (const target of Objectscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/Object#.keysscip-typescript npm typescript 5.9.3 lib/`lib.es5.d.ts`/ObjectConstructor#keys().(filteredList) as Targetscip-typescript npm @babel/helper-compilation-targets 7.20.7 src/`types.d.ts`/Target#[]) {
39 if (!first) formattedTargets += `,`;
40 first = false;
41 formattedTargets += ` ${target}`;
42 if (support[target]) formattedTargets += ` < ${support[target]}`;
43 }
44 formattedTargets += ` }`;
45
46 consolescip-typescript npm typescript 5.9.3 lib/`lib.dom.d.ts`/console..logscip-typescript npm typescript 5.9.3 lib/`lib.dom.d.ts`/Console#log().(` ${item} ${formattedTargets}`);
47 };