Skip to content

Commit

Permalink
fix: Resolve unchecked path for non-Windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuki31 committed May 21, 2024
1 parent 62bce18 commit 10e4af3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lsfnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ function resolveFileURL(p: StringPath): StringPath {
if (/^file:(?:\/\/\/?)$/.test(p)) p = '/';
// Otherwise, parse the file URL path
else p = fileURLToPath(p);
} else if ((os.platform() !== 'win32' && isWin32Path(p))
} else if ((os.platform() !== 'win32'
&& (isWin32Path(p) || !p.startsWith('file:')))
|| (os.platform() === 'win32'
&& !(isWin32Path(p) || p.startsWith('file:')))) {
throw new URIError('Invalid file URL scheme');
Expand Down

0 comments on commit 10e4af3

Please sign in to comment.