JS: Address some more review comments

This commit is contained in:
Asger Feldthaus
2020-09-22 14:25:13 +01:00
parent b1bd612232
commit 0ddd825ea6
3 changed files with 4 additions and 2 deletions

View File

@@ -103,7 +103,7 @@ class State {
public packageTypings = new Map<string, string | undefined>();
/** Map from file path to the enclosing `package.json` file, if any. Will not traverse outside node_modules. */
public enclosingPackageJson = new Map<string, string>();
public enclosingPackageJson = new Map<string, string | undefined>();
}
let state = new State();

View File

@@ -71,7 +71,7 @@ public class AsyncFetcher {
}
/** Result of a tarball extraction */
class ExtractionResult {
private static class ExtractionResult {
/** The directory into which the tarball was extracted. */
Path destDir;

View File

@@ -105,6 +105,8 @@ public class Fetcher {
// Despite having the .tgz extension, the file is not always gzipped, sometimes it's just a raw tar archive,
// regardless of what Accept-Encoding header we send.
// Sniff the header to detect which is the case.
// Note that the compression format has nothing to do with the Accept-Encoding/Content-Encoding headers,
// so we can't reuse the code from fetch().
PushbackInputStream pushback = new PushbackInputStream(rawStream, 2);
int byte1 = pushback.read();
int byte2 = pushback.read();