mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Pure refactor: Consolidate isWithinRoot() function calling. (#4163)
This commit is contained in:
committed by
GitHub
parent
e584241141
commit
fefa7ecbea
@@ -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:\').
|
||||
|
||||
Reference in New Issue
Block a user