mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-31 07:08:40 -04:00
chore(deps): upgrade diff to 7.0.0
Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
3077b20a06
commit
89a6b79de5
6 changed files with 18 additions and 33 deletions
|
@ -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",
|
||||
|
|
|
@ -4,20 +4,6 @@ exports[`invert unified patch inverts a patch correctly 1`] = `
|
|||
{
|
||||
"hunks": [
|
||||
{
|
||||
"linedelimiters": [
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
"
|
||||
",
|
||||
],
|
||||
"lines": [
|
||||
"+a",
|
||||
"+b",
|
||||
|
|
|
@ -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)}`
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue