This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -164,7 +164,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
}
props.depthOffset = newCommonPath.length;
props.commonPath = newCommonPath;
props.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd;
props.root = newCommonPath.length > 0 ? import_node_path.default.posix.join(cwd, ...newCommonPath) : cwd;
}
return result;
}
@@ -203,7 +203,7 @@ function getRelativePath(path2, cwd, root) {
return import_node_path.posix.relative(cwd, `${root}/${path2}`) || ".";
}
function processPath(path2, cwd, root, isDirectory, absolute) {
const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2;
const relativePath = absolute ? path2.slice(root === "/" ? 1 : root.length + 1) || "." : path2;
if (root === cwd) {
return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
}

View File

@@ -126,7 +126,7 @@ function normalizePattern(pattern, expandDirectories, cwd, props, isIgnore) {
}
props.depthOffset = newCommonPath.length;
props.commonPath = newCommonPath;
props.root = newCommonPath.length > 0 ? `${cwd}/${newCommonPath.join("/")}` : cwd;
props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
}
return result;
}
@@ -165,7 +165,7 @@ function getRelativePath(path2, cwd, root) {
return posix.relative(cwd, `${root}/${path2}`) || ".";
}
function processPath(path2, cwd, root, isDirectory, absolute) {
const relativePath = absolute ? path2.slice(root.length + 1) || "." : path2;
const relativePath = absolute ? path2.slice(root === "/" ? 1 : root.length + 1) || "." : path2;
if (root === cwd) {
return isDirectory && relativePath !== "." ? relativePath.slice(0, -1) : relativePath;
}