(config: Config, json: boolean)
| 4 | import { output } from '../log'; |
| 5 | |
| 6 | export async function configCommand(config: Config, json: boolean): Promise<void> { |
| 7 | const evaluatedConfig = await deepAwait(config); |
| 8 | |
| 9 | if (json) { |
| 10 | process.stdout.write(`${JSON.stringify(evaluatedConfig)}\n`); |
| 11 | } else { |
| 12 | output.write(`${util.inspect(evaluatedConfig, { depth: Infinity, colors: true })}\n`); |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | async function deepAwait(obj: any): Promise<any> { |
| 17 | if (obj && !Array.isArray(obj) && typeof obj === 'object' && obj.constructor === Object) { |
no test coverage detected