()
| 1183 | // Returns the next entry header, or `undefined` once the archive and the |
| 1184 | // input have ended. Input after the end of the archive is discarded. |
| 1185 | next(): Header | undefined | typeof NeedInput { |
| 1186 | try { |
| 1187 | return this.advance() |
| 1188 | } catch (error) { |
| 1189 | // Header errors are thrown where the archive offset is not known |
| 1190 | if (isTarError(error) && (error.kind === "InvalidHeader" || error.kind === "Unsupported")) { |
| 1191 | throw new TarError({ kind: error.kind, message: `${error.message} (header at byte ${this.at})` }) |
| 1192 | } |
| 1193 | throw error |
| 1194 | } |
| 1195 | } |
| 1196 | |
| 1197 | private advance(): Header | undefined | typeof NeedInput { |
| 1198 | this.generation++ |
no test coverage detected