MCPcopy
hub / github.com/prettier/prettier / createChoiceUsages

Function createChoiceUsages

src/cli/usage.js:71–81  ·  view source on GitHub ↗
(choices, margin, indentation)

Source from the content-addressed store, hash-verified

69}
70
71function createChoiceUsages(choices, margin, indentation) {
72 const activeChoices = choices.filter((choice) => !choice.deprecated);
73 const threshold =
74 Math.max(0, ...activeChoices.map((choice) => choice.value.length)) + margin;
75 return activeChoices.map((choice) =>
76 indent(
77 createOptionUsageRow(choice.value, choice.description, threshold),
78 indentation,
79 ),
80 );
81}
82
83function createOptionUsage(context, option, threshold) {
84 const header = createOptionUsageHeader(option);

Callers 1

createDetailedUsageFunction · 0.85

Calls 3

createOptionUsageRowFunction · 0.85
indentFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…