UNPKG

1.14 kBJavaScriptView Raw
1const chalk = require("chalk");
2const figures = require("figures");
3const main = require("../main");
4
5function bool2Symbol(pBool) {
6 return pBool ? chalk.green(figures.tick) : chalk.red(figures.cross);
7}
8
9function formatTranspilers() {
10 return main
11 .getAvailableTranspilers()
12 .reduce(
13 (pAll, pThis) =>
14 `${pAll} ${bool2Symbol(pThis.available)} ${pThis.name} (${
15 pThis.version
16 })\n`,
17 ` ${bool2Symbol(true)} javascript (>es1)\n`
18 );
19}
20
21function formatExtensions(pExtensions) {
22 return pExtensions.reduce(
23 (pAll, pThis) =>
24 `${pAll} ${bool2Symbol(pThis.available)} ${pThis.extension}\n`,
25 ""
26 );
27}
28
29module.exports = () => `
30 Supported:
31
32 If you need a supported, but not enabled transpiler ('${chalk.red(
33 figures.cross
34 )}' below), just install
35 it in the same folder dependency-cruiser is installed. E.g. 'npm i livescript'
36 will enable livescript support if it's installed in your project folder.
37
38 Transpilers:
39
40${formatTranspilers()}
41 Extensions:
42
43${formatExtensions(main.allExtensions)}
44`;
45
46/* eslint security/detect-object-injection : 0 */