forked from farhoodlabs/paperclip
Address Greptile review fixes
This commit is contained in:
@@ -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>) {
|
||||
|
||||
Reference in New Issue
Block a user