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 3077b20a06
commit 89a6b79de5
No known key found for this signature in database
GPG key ID: DB99ADDDC5C0AF82
6 changed files with 18 additions and 33 deletions

View file

@ -60,7 +60,7 @@
"d3-graphviz": "5.6.0",
"d3-selection": "3.0.0",
"deepmerge": "4.3.1",
"diff": "5.2.0",
"diff": "7.0.0",
"dom-serializer": "2.0.0",
"domhandler": "5.0.3",
"dompurify": "3.1.6",
@ -127,7 +127,7 @@
"@testing-library/react-hooks": "8.0.1",
"@testing-library/user-event": "14.5.2",
"@types/d3-graphviz": "2.6.10",
"@types/diff": "5.2.3",
"@types/diff": "6.0.0",
"@types/dompurify": "3.0.5",
"@types/jest": "29.5.13",
"@types/katex": "0.16.7",

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
}
/**