Address Greptile review fixes

This commit is contained in:
Dotta 2026-03-15 06:13:50 -05:00
parent 269dd6abbe
commit 5de5fb507a
3 changed files with 39 additions and 22 deletions

View file

@ -70,7 +70,16 @@ function isPlainRecord(value: unknown): value is Record<string, unknown> {
}
function normalizePortablePath(input: string) {
return input.replace(/\\/g, "/").replace(/^\.\/+/, "").replace(/^\/+/, "");
const parts: string[] = [];
for (const segment of input.replace(/\\/g, "/").replace(/^\.\/+/, "").replace(/^\/+/, "").split("/")) {
if (!segment || segment === ".") continue;
if (segment === "..") {
if (parts.length > 0) parts.pop();
continue;
}
parts.push(segment);
}
return parts.join("/");
}
function normalizePackageFileMap(files: Record<string, string>) {