mirror of
https://github.com/github/codeql.git
synced 2026-05-01 11:45:14 +02:00
JS: Address some more review comments
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user