react-diff-view
Advanced tools
Comparing version 1.4.0 to 1.4.1
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
595329
1557
475