()
| 125 | } |
| 126 | |
| 127 | private async maybeReadHeaderLine() { |
| 128 | if (this.hasHeader) { |
| 129 | const iter = await this.base.iterator(); |
| 130 | const firstElement = await iter.next(); |
| 131 | if (firstElement.done) { |
| 132 | throw new Error('No data was found for CSV parsing.'); |
| 133 | } |
| 134 | const firstLine: string = firstElement.value; |
| 135 | const headers = this.parseRow(firstLine, false); |
| 136 | return headers; |
| 137 | } else { |
| 138 | return null; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Create a `CSVDataset`. |
no test coverage detected