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
21 lines • 743 B
JavaScript
import { PlainTextFormatter } from './PlainTextFormatter.js';
import { JsonFormatter } from './JsonFormatter.js';
import { logger } from '../../services/logger.js';
/**
* Factory function to create the appropriate formatter for viewer data
* @param format The format to use
* @returns A ViewerFormatter instance
*/
export function getViewerFormatter(format = 'plain') {
switch (format.toLowerCase()) {
case 'plain':
case 'text':
return new PlainTextFormatter();
case 'json':
return new JsonFormatter();
default:
logger.warn(`Unknown format '${format}', defaulting to plain text`);
return new PlainTextFormatter();
}
}
//# sourceMappingURL=index.js.map