Skip to content

Commit 0ddd825

Browse files
committed
JS: Address some more review comments
1 parent b1bd612 commit 0ddd825

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

javascript/extractor/lib/typescript/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class State {
103103
public packageTypings = new Map<string, string | undefined>();
104104

105105
/** Map from file path to the enclosing `package.json` file, if any. Will not traverse outside node_modules. */
106-
public enclosingPackageJson = new Map<string, string>();
106+
public enclosingPackageJson = new Map<string, string | undefined>();
107107
}
108108
let state = new State();
109109

javascript/extractor/src/com/semmle/js/dependencies/AsyncFetcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public CompletableFuture<Packument> getPackument(String packageName) {
7171
}
7272

7373
/** Result of a tarball extraction */
74-
class ExtractionResult {
74+
private static class ExtractionResult {
7575
/** The directory into which the tarball was extracted. */
7676
Path destDir;
7777

javascript/extractor/src/com/semmle/js/dependencies/Fetcher.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public List<Path> extractFromTarballUrl(String tarballUrl, Path destDir) throws
105105
// Despite having the .tgz extension, the file is not always gzipped, sometimes it's just a raw tar archive,
106106
// regardless of what Accept-Encoding header we send.
107107
// Sniff the header to detect which is the case.
108+
// Note that the compression format has nothing to do with the Accept-Encoding/Content-Encoding headers,
109+
// so we can't reuse the code from fetch().
108110
PushbackInputStream pushback = new PushbackInputStream(rawStream, 2);
109111
int byte1 = pushback.read();
110112
int byte2 = pushback.read();

0 commit comments

Comments
 (0)