(
lines: string,
inputFilename?: string,
pathPrefix?: string,
options: LineParseOptions = DefaultLineParseOptions,
)
| 224 | } |
| 225 | |
| 226 | export function parseOutput( |
| 227 | lines: string, |
| 228 | inputFilename?: string, |
| 229 | pathPrefix?: string, |
| 230 | options: LineParseOptions = DefaultLineParseOptions, |
| 231 | ): ResultLine[] { |
| 232 | const result: ResultLine[] = []; |
| 233 | eachLine(lines, line => { |
| 234 | if (options.includes(LineParseOption.SourceMasking)) { |
| 235 | line = _parseOutputLine(line, inputFilename, pathPrefix); |
| 236 | } |
| 237 | if (!inputFilename && options.includes(LineParseOption.RootMasking)) { |
| 238 | line = maskRootdir(line); |
| 239 | } |
| 240 | if (line !== null) { |
| 241 | const lineObj: ResultLine = {text: line}; |
| 242 | const filteredLine = filterEscapeSequences(line); |
| 243 | |
| 244 | if (options.includes(LineParseOption.SourceWithLineMessage)) |
| 245 | applyParse_SourceWithLine(lineObj, filteredLine, inputFilename); |
| 246 | |
| 247 | if (!lineObj.tag && options.includes(LineParseOption.FileWithLineMessage)) |
| 248 | applyParse_FileWithLine(lineObj, filteredLine); |
| 249 | |
| 250 | if (!lineObj.tag && options.includes(LineParseOption.AtFileLine)) |
| 251 | applyParse_AtFileLine(lineObj, filteredLine); |
| 252 | |
| 253 | result.push(lineObj); |
| 254 | } |
| 255 | }); |
| 256 | return result; |
| 257 | } |
| 258 | |
| 259 | export function parseRustOutput(lines: string, inputFilename?: string, pathPrefix?: string) { |
| 260 | const inputBasename = inputFilename ? path.basename(inputFilename) : undefined; |
no test coverage detected