react-diff-view
Advanced tools
Comparing version 1.4.10 to 1.4.11
{ | ||
"name": "react-diff-view", | ||
"version": "1.4.10", | ||
"version": "1.4.11", | ||
"description": "A git diff component to consume the git unified diff output.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -513,1 +513,5 @@ # react-diff-view | ||
- Fix a logic bug when split range of lines into valid ones. | ||
### 1.4.11 | ||
- Fix a bug where a stub hunk will crash the hunk insertion. |
@@ -327,3 +327,10 @@ import leven from 'leven'; | ||
const insertionOldLineNumber = computeOldLineNumber(insertion.changes[0]); | ||
const insertPosition = hunks.findIndex(hunk => computeOldLineNumber(hunk.changes[0]) >= insertionOldLineNumber); | ||
const isLaterThanInsertion = ({changes}) => { | ||
if (!changes.length) { | ||
return false; | ||
} | ||
return computeOldLineNumber(changes[0]) >= insertionOldLineNumber; | ||
}; | ||
const insertPosition = hunks.findIndex(isLaterThanInsertion); | ||
const hunksWithInsertion = insertPosition === -1 | ||
@@ -330,0 +337,0 @@ ? hunks.concat(insertion) |
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
706168
1723
517