UNPKG

@t1mmen/srtd

Version:

Supabase Repeatable Template Definitions (srtd): 🪄 Live-reloading SQL templates for Supabase DX. Make your database changes reviewable and migrations maintainable! 🚀

24 lines • 848 B
import { renderResultsTable } from '../ui/resultsTable.js'; import { formatJsonOutput, writeJson } from './jsonOutput.js'; /** * Output results in either JSON or human-readable format. * Branches based on context.json flag. * * - JSON: Uses writeJson() for clean output (no extra newlines) * - Human: Delegates to existing renderResultsTable * * Note: This function is specifically for build/apply commands. * Other commands use their own output mechanisms. */ export function output(options) { const { results, context } = options; if (context.json) { const jsonOutput = formatJsonOutput(results, context.command); writeJson(jsonOutput); } else { // Cast is safe: BatchOutputOptions is a subset of RenderResultsOptions renderResultsTable(options); } } //# sourceMappingURL=output.js.map