From 6cb0a0acbb9b77714278bc513bcbfe104420dd8d Mon Sep 17 00:00:00 2001 From: Alex Ross <38270282+alexr00@users.noreply.github.com> Date: Wed, 3 Dec 2025 12:54:56 +0100 Subject: [PATCH] Move case sensitivity check earlier in isDescendant --- src/common/utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/utils.ts b/src/common/utils.ts index 470e0a5379..59c9944e55 100644 --- a/src/common/utils.ts +++ b/src/common/utils.ts @@ -103,6 +103,12 @@ function isWindowsPath(path: string): boolean { } export function isDescendant(parent: string, descendant: string, separator: string = sep): boolean { + // Windows is case insensitive + if (isWindowsPath(parent)) { + parent = parent.toLowerCase(); + descendant = descendant.toLowerCase(); + } + if (parent === descendant) { return true; } @@ -111,12 +117,6 @@ export function isDescendant(parent: string, descendant: string, separator: stri parent += separator; } - // Windows is case insensitive - if (isWindowsPath(parent)) { - parent = parent.toLowerCase(); - descendant = descendant.toLowerCase(); - } - return descendant.startsWith(parent); }