diff --git a/backend/package.json b/backend/package.json index 9c147e74f..26638bab2 100644 --- a/backend/package.json +++ b/backend/package.json @@ -48,7 +48,7 @@ "cli-color": "2.0.4", "connect-typeorm": "2.0.0", "cookie": "0.7.2", - "diff": "5.2.0", + "diff": "7.0.0", "express-session": "1.18.1", "file-type": "16.5.4", "htmlparser2": "9.1.0", @@ -80,7 +80,7 @@ "@types/cli-color": "2.0.6", "@types/cookie": "0.6.0", "@types/cookie-signature": "1.1.2", - "@types/diff": "5.2.3", + "@types/diff": "6.0.0", "@types/express": "5.0.0", "@types/express-session": "1.18.0", "@types/jest": "29.5.13", diff --git a/frontend/package.json b/frontend/package.json index 004fc49f6..6ebc86f96 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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", diff --git a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/__snapshots__/invert-unified-patch.spec.ts.snap b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/__snapshots__/invert-unified-patch.spec.ts.snap index fdfc874c8..ef3a06ba4 100644 --- a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/__snapshots__/invert-unified-patch.spec.ts.snap +++ b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/__snapshots__/invert-unified-patch.spec.ts.snap @@ -4,20 +4,6 @@ exports[`invert unified patch inverts a patch correctly 1`] = ` { "hunks": [ { - "linedelimiters": [ - " -", - " -", - " -", - " -", - " -", - " -", - ], "lines": [ "+a", "+b", diff --git a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/invert-unified-patch.ts b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/invert-unified-patch.ts index 049b26f95..7976d6b48 100644 --- a/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/invert-unified-patch.ts +++ b/frontend/src/components/editor-page/sidebar/specific-sidebar-entries/revisions-sidebar-entry/revisions-modal/invert-unified-patch.ts @@ -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)}` diff --git a/frontend/src/components/markdown-renderer/markdown-to-react/utils/line-content-to-line-id-mapper.ts b/frontend/src/components/markdown-renderer/markdown-to-react/utils/line-content-to-line-id-mapper.ts index d207eea41..70c6834f4 100644 --- a/frontend/src/components/markdown-renderer/markdown-to-react/utils/line-content-to-line-id-mapper.ts +++ b/frontend/src/components/markdown-renderer/markdown-to-react/utils/line-content-to-line-id-mapper.ts @@ -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 } /** diff --git a/yarn.lock b/yarn.lock index bf1a5cfb3..28ac9b4ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2577,7 +2577,7 @@ __metadata: "@types/cli-color": "npm:2.0.6" "@types/cookie": "npm:0.6.0" "@types/cookie-signature": "npm:1.1.2" - "@types/diff": "npm:5.2.3" + "@types/diff": "npm:6.0.0" "@types/express": "npm:5.0.0" "@types/express-session": "npm:1.18.0" "@types/jest": "npm:29.5.13" @@ -2600,7 +2600,7 @@ __metadata: cli-color: "npm:2.0.4" connect-typeorm: "npm:2.0.0" cookie: "npm:0.7.2" - diff: "npm:5.2.0" + diff: "npm:7.0.0" eslint: "npm:8.57.1" eslint-config-prettier: "npm:9.1.0" eslint-plugin-import: "npm:2.31.0" @@ -2715,7 +2715,7 @@ __metadata: "@testing-library/react-hooks": "npm:8.0.1" "@testing-library/user-event": "npm:14.5.2" "@types/d3-graphviz": "npm:2.6.10" - "@types/diff": "npm:5.2.3" + "@types/diff": "npm:6.0.0" "@types/dompurify": "npm:3.0.5" "@types/jest": "npm:29.5.13" "@types/katex": "npm:0.16.7" @@ -2741,7 +2741,7 @@ __metadata: d3-graphviz: "npm:5.6.0" d3-selection: "npm:3.0.0" deepmerge: "npm:4.3.1" - diff: "npm:5.2.0" + diff: "npm:7.0.0" dom-serializer: "npm:2.0.0" domhandler: "npm:5.0.3" dompurify: "npm:3.1.6" @@ -5268,10 +5268,10 @@ __metadata: languageName: node linkType: hard -"@types/diff@npm:5.2.3": - version: 5.2.3 - resolution: "@types/diff@npm:5.2.3" - checksum: 10c0/dd2e99e272a7023f3e5c71099599553c7d6c9a6b9d67f202b593b8d59b0528361eba39a8674ab18eba76217b6bad8f1a09417a9a571daaf7c0f49d67d4f305e2 +"@types/diff@npm:6.0.0": + version: 6.0.0 + resolution: "@types/diff@npm:6.0.0" + checksum: 10c0/229325cd8039de546dc370d63d62eaf5774122a616eb09cd446d479181e58e941c2983303d23ebcb405109b1b2653ab3bbfcf63a24f827e976e98c8eb83dd34f languageName: node linkType: hard @@ -9353,10 +9353,10 @@ __metadata: languageName: node linkType: hard -"diff@npm:5.2.0": - version: 5.2.0 - resolution: "diff@npm:5.2.0" - checksum: 10c0/aed0941f206fe261ecb258dc8d0ceea8abbde3ace5827518ff8d302f0fc9cc81ce116c4d8f379151171336caf0516b79e01abdc1ed1201b6440d895a66689eb4 +"diff@npm:7.0.0": + version: 7.0.0 + resolution: "diff@npm:7.0.0" + checksum: 10c0/251fd15f85ffdf814cfc35a728d526b8d2ad3de338dcbd011ac6e57c461417090766b28995f8ff733135b5fbc3699c392db1d5e27711ac4e00244768cd1d577b languageName: node linkType: hard