Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abb2f8a

Browse files
committed
Handle Windows absolute paths in resolveUriToFile
1 parent 845cb25 commit abb2f8a

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/fingerprints.js

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/fingerprints.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fingerprints.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as fs from "fs";
2+
import path from "path";
23

34
import Long from "long";
45

@@ -226,7 +227,7 @@ export function resolveUriToFile(
226227
// Just assume a relative path is relative to the src root.
227228
// This is not necessarily true but should be a good approximation
228229
// and here we likely want to err on the side of handling more cases.
229-
if (!uri.startsWith("/")) {
230+
if (!path.isAbsolute(uri)) {
230231
uri = srcRootPrefix + uri;
231232
}
232233

0 commit comments

Comments
 (0)