mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Correct path segment regex (#44149)
The old version incorrectly matched anything with a leading or trailing slash. The empty segment should only be detected between two slashes.
This commit is contained in:
parent
89a737c871
commit
87d0b3e07a
@ -658,7 +658,7 @@ namespace ts {
|
||||
//// Path Comparisons
|
||||
|
||||
// check path for these segments: '', '.'. '..'
|
||||
const relativePathSegmentRegExp = /(^|\/)\.{0,2}($|\/)/;
|
||||
const relativePathSegmentRegExp = /(?:\/\/)|(?:^|\/)\.\.?(?:$|\/)/;
|
||||
|
||||
function comparePathsWorker(a: string, b: string, componentComparer: (a: string, b: string) => Comparison) {
|
||||
if (a === b) return Comparison.EqualTo;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user