mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-03 08:28:54 -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
0bb09a1597
commit
e65cbd95d9
6 changed files with 18 additions and 33 deletions
|
@ -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