( confirm: string, message: string, leadingSymbol: string, trailingSymbol: string, options?: RenderOptions | undefined )
| 2226 | } |
| 2227 | |
| 2228 | const renderPrompt = ( |
| 2229 | confirm: string, |
| 2230 | message: string, |
| 2231 | leadingSymbol: string, |
| 2232 | trailingSymbol: string, |
| 2233 | options?: RenderOptions | undefined |
| 2234 | ) => { |
| 2235 | const prefix = leadingSymbol + " " |
| 2236 | const annotate = options?.plain === true |
| 2237 | ? (line: string) => line |
| 2238 | : annotateLine |
| 2239 | return Arr.match(message.split(NEWLINE_REGEXP), { |
| 2240 | onEmpty: () => prefix + " " + trailingSymbol + " " + confirm, |
| 2241 | onNonEmpty: (promptLines) => { |
| 2242 | const lines = Arr.map(promptLines, (line) => annotate(line)) |
| 2243 | return prefix + lines.join("\n") + " " + trailingSymbol + " " + confirm |
| 2244 | } |
| 2245 | }) |
| 2246 | } |
| 2247 | |
| 2248 | const renderPrefix = ( |
| 2249 | state: FileState, |
no test coverage detected