diff options
| author | Tommaso Sciortino <[email protected]> | 2025-07-14 22:55:49 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-15 05:55:49 +0000 |
| commit | fefa7ecbea2ab985e48679ceb3010a174777a188 (patch) | |
| tree | 94777677e2e7e0c72e8f75941d8594b898e67192 /packages/core/src/utils/fileUtils.ts | |
| parent | e584241141b74ab503a527fad158d60eb06c38fe (diff) | |
Pure refactor: Consolidate isWithinRoot() function calling. (#4163)
Diffstat (limited to 'packages/core/src/utils/fileUtils.ts')
| -rw-r--r-- | packages/core/src/utils/fileUtils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/core/src/utils/fileUtils.ts b/packages/core/src/utils/fileUtils.ts index a6b2e456..33eda6ab 100644 --- a/packages/core/src/utils/fileUtils.ts +++ b/packages/core/src/utils/fileUtils.ts @@ -36,8 +36,8 @@ export function isWithinRoot( pathToCheck: string, rootDirectory: string, ): boolean { - const normalizedPathToCheck = path.normalize(pathToCheck); - const normalizedRootDirectory = path.normalize(rootDirectory); + const normalizedPathToCheck = path.resolve(pathToCheck); + const normalizedRootDirectory = path.resolve(rootDirectory); // Ensure the rootDirectory path ends with a separator for correct startsWith comparison, // unless it's the root path itself (e.g., '/' or 'C:\'). |
