chore(deps): upgrade diff to 7.0.0

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
Erik Michelson 2024-11-11 16:34:48 +01:00
parent 0bb09a1597
commit e65cbd95d9
6 changed files with 18 additions and 33 deletions

View file

@ -4,20 +4,6 @@ exports[`invert unified patch inverts a patch correctly 1`] = `
{
"hunks": [
{
"linedelimiters": [
"
",
"
",
"
",
"
",
"
",
"
",
],
"lines": [
"+a",
"+b",

View file

@ -16,13 +16,12 @@ export const invertUnifiedPatch = (parsedDiff: ParsedDiff): ParsedDiff => {
const { oldFileName, newFileName, oldHeader, newHeader, hunks, index } = parsedDiff
const newHunks: Hunk[] = hunks.map((hunk) => {
const { oldLines, oldStart, newLines, newStart, lines, linedelimiters } = hunk
const { oldLines, oldStart, newLines, newStart, lines } = hunk
return {
oldLines: newLines,
oldStart: newStart,
newLines: oldLines,
newStart: oldStart,
linedelimiters: linedelimiters,
lines: lines.map((line) => {
if (line.startsWith('-')) {
return `+${line.slice(1)}`

View file

@ -73,7 +73,7 @@ export class LineContentToLineIdMapper {
* @return {@link true} if the given change is neither adding nor removing lines.
*/
private static changeIsNotChangingLines(change: LineChange): boolean {
return change.added === undefined && change.removed === undefined
return change.added === false && change.removed === false
}
/**