chore: generate
This commit is contained in:
@@ -8,14 +8,8 @@ export function getRevertDiffFiles(diffText: string) {
|
|||||||
const filename = [patch.newFileName, patch.oldFileName].find((item) => item && item !== "/dev/null") ?? "unknown"
|
const filename = [patch.newFileName, patch.oldFileName].find((item) => item && item !== "/dev/null") ?? "unknown"
|
||||||
return {
|
return {
|
||||||
filename: filename.replace(/^[ab]\//, ""),
|
filename: filename.replace(/^[ab]\//, ""),
|
||||||
additions: patch.hunks.reduce(
|
additions: patch.hunks.reduce((sum, hunk) => sum + hunk.lines.filter((line) => line.startsWith("+")).length, 0),
|
||||||
(sum, hunk) => sum + hunk.lines.filter((line) => line.startsWith("+")).length,
|
deletions: patch.hunks.reduce((sum, hunk) => sum + hunk.lines.filter((line) => line.startsWith("-")).length, 0),
|
||||||
0,
|
|
||||||
),
|
|
||||||
deletions: patch.hunks.reduce(
|
|
||||||
(sum, hunk) => sum + hunk.lines.filter((line) => line.startsWith("-")).length,
|
|
||||||
0,
|
|
||||||
),
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
Reference in New Issue
Block a user