(formatter: (indent: number) => OutputFormatter<T>)
| 40 | let retVal = previousValue |
| 41 | |
| 42 | const preview = async (formatter: (indent: number) => OutputFormatter<T>): Promise<void> => { |
| 43 | // TODO: this should probably be moved to someplace more common |
| 44 | const indent = command.flags.indent |
| 45 | ?? (command.cliConfig.profile.indent as number | undefined) |
| 46 | ?? (formatter === yamlFormatter ? 2 : 4) |
| 47 | const output = formatter(indent)(retVal) |
| 48 | |
| 49 | const editAgain = await booleanInput( |
| 50 | output + '\n\nWould you like to edit further?', |
| 51 | { default: false }, |
| 52 | ) |
| 53 | if (editAgain) { |
| 54 | const answer = await inputDefinition.updateFromUserInput(retVal) |
| 55 | if (answer !== cancelAction) { |
| 56 | retVal = answer |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | // eslint-disable-next-line no-constant-condition |
| 62 | while (true) { |
no test coverage detected