(resultLines: ProcessLineResult[])
| 20 | private finalResult: any[] = []; |
| 21 | constructor(private converter: Converter) { } |
| 22 | processResult(resultLines: ProcessLineResult[]): Promise<any> { |
| 23 | const startPos = this.converter.parseRuntime.parsedLineNumber; |
| 24 | if (this.needPushDownstream && this.converter.parseParam.downstreamFormat === "array") { |
| 25 | if (startPos === 0) { |
| 26 | pushDownstream(this.converter, "[" + EOL); |
| 27 | } |
| 28 | } |
| 29 | // let prom: Promise<any>; |
| 30 | return new Promise((resolve, reject) => { |
| 31 | if (this.needEmitLine) { |
| 32 | processLineByLine( |
| 33 | resultLines, |
| 34 | this.converter, |
| 35 | 0, |
| 36 | this.needPushDownstream, |
| 37 | (err) => { |
| 38 | if (err) { |
| 39 | reject(err); |
| 40 | } else { |
| 41 | this.appendFinalResult(resultLines); |
| 42 | resolve(undefined); |
| 43 | } |
| 44 | }, |
| 45 | ) |
| 46 | // resolve(); |
| 47 | } else { |
| 48 | this.appendFinalResult(resultLines); |
| 49 | resolve(undefined); |
| 50 | } |
| 51 | }) |
| 52 | } |
| 53 | appendFinalResult(lines: any[]) { |
| 54 | if (this.needEmitAll) { |
| 55 | this.finalResult = this.finalResult.concat(lines); |
no test coverage detected