react-diff-view
Advanced tools
Comparing version
{ | ||
"name": "react-diff-view", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A git diff component to consume the git unified diff output.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -471,1 +471,5 @@ # react-diff-view | ||
- `stubHunk` option on `parse` function is deprecated. | ||
### 1.4.1 | ||
- Fix an edge case in `sliceHunk`. |
@@ -94,3 +94,3 @@ import leven from 'leven'; | ||
const baseLineNumber = baseSide === 'old' ? computeOldLineNumber : computeNewLineNumber; | ||
const correspondingLineNumber = baseSide === 'old' ? computeOldLineNumber : computeNewLineNumber; | ||
const correspondingLineNumber = baseSide === 'old' ? computeNewLineNumber : computeOldLineNumber; | ||
const isInHunk = createIsInHunkFunction(baseStart, baseLines); | ||
@@ -180,2 +180,6 @@ const isBetweenHunks = createIsBetweenHunksFunction(baseStart, baseLines); | ||
if (!slicedChanges.length) { | ||
return null; | ||
} | ||
const firstChange = first(slicedChanges); | ||
@@ -200,2 +204,10 @@ const oldStart = computeOldLineNumber(firstChange); | ||
const mergeHunk = (previousHunk, nextHunk) => { | ||
if (!previousHunk) { | ||
return nextHunk; | ||
} | ||
if (!nextHunk) { | ||
return previousHunk; | ||
} | ||
const previousStart = computeOldLineNumber(first(previousHunk.changes)); | ||
@@ -202,0 +214,0 @@ const previousEnd = computeOldLineNumber(last(previousHunk.changes)); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
595329
0.09%1557
0.58%475
0.85%