()
| 36 | } |
| 37 | |
| 38 | async iterator(): Promise<LazyIterator<string>> { |
| 39 | const inputIterator = await this.input.iterator(); |
| 40 | const utf8Iterator = inputIterator.decodeUTF8(); |
| 41 | const lineIterator = utf8Iterator.split('\n').map(line => { |
| 42 | // Windows/DOS format text file has extra line breaker at the end of line. |
| 43 | if (line.endsWith('\r')) { |
| 44 | line = line.slice(0, -1); |
| 45 | } |
| 46 | return line; |
| 47 | }); |
| 48 | return lineIterator; |
| 49 | } |
| 50 | } |