Scaffold LogicSRC and CommandBoard plugins

This commit is contained in:
Anthony Ettinger 2026-06-06 11:24:02 +00:00
parent 59927e140c
commit 5c9ea821f6
67 changed files with 5958 additions and 0 deletions

View file

@ -0,0 +1,22 @@
export type OutputFormat = "json" | "table" | "markdown";
export function print(data: unknown, format: OutputFormat) {
if (format === "json") {
console.log(JSON.stringify(data, null, 2));
return;
}
if (format === "markdown") {
if (Array.isArray(data)) {
for (const item of data) {
console.log(`- ${Object.entries(item as Record<string, unknown>).map(([key, value]) => `**${key}:** ${String(value)}`).join(", ")}`);
}
return;
}
console.log(Object.entries(data as Record<string, unknown>).map(([key, value]) => `**${key}:** ${String(value)}`).join("\n"));
return;
}
console.table(data);
}