UNPKG

825 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.logPlugin = void 0;
7
8var _helperCompilationTargets = require("@babel/helper-compilation-targets");
9
10const logPlugin = (item, targetVersions, list) => {
11 const filteredList = (0, _helperCompilationTargets.getInclusionReasons)(item, targetVersions, list);
12 const support = list[item];
13
14 if (!support) {
15 console.log(` ${item}`);
16 return;
17 }
18
19 let formattedTargets = `{`;
20 let first = true;
21
22 for (const target of Object.keys(filteredList)) {
23 if (!first) formattedTargets += `,`;
24 first = false;
25 formattedTargets += ` ${target}`;
26 if (support[target]) formattedTargets += ` < ${support[target]}`;
27 }
28
29 formattedTargets += ` }`;
30 console.log(` ${item} ${formattedTargets}`);
31};
32
33exports.logPlugin = logPlugin;
\No newline at end of file