UNPKG

bktide

Version:

Command-line interface for Buildkite CI/CD workflows with rich shell completions (Fish, Bash, Zsh) and Alfred workflow integration for macOS power users

20 lines 743 B
import { BaseFormatter } from './Formatter.js'; export class JsonFormatter extends BaseFormatter { name = 'JSON'; formatAnnotations(annotations, options) { if (options?.hasError) { return JSON.stringify({ error: true, message: options.errorMessage || 'Unknown error occurred', type: options.errorType || 'unknown' }, null, 2); } const result = { annotations: annotations || [], count: annotations ? annotations.length : 0, ...(options?.contextFilter && { contextFilter: options.contextFilter }) }; return JSON.stringify(result, null, 2); } } //# sourceMappingURL=JsonFormatter.js.map