XYOracleNetwork/clients

View on GitHub
packages/cli/src/lib/print/printLine.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { terminal } from 'terminal-kit'

import { newline } from './newline.js'

export type TextColor = 'green' | 'yellow' | 'red' | 'default'

export const printLine = (text?: string | undefined, color: TextColor = 'default') => {
  switch (color) {
    case 'green': {
      terminal.green(text)
      break
    }
    case 'yellow': {
      terminal.yellow(text)
      break
    }
    case 'red': {
      terminal.red(text)
      break
    }
    case 'default': {
      terminal(text)
    }
  }
  newline()
}