Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
I was facing an issue when we use spliceColumns when there are merged cells in the sliced column range. Which resulted in breaking the excel output as the row.slice was deleting the values of the merged cells and wasn't moving the other merged cells position as per the deleted columns.
Test plan
Create a sheet with 2 different merged cells in a row then try to add a spliceColumns line after that with out any insert. Let's say if the spliceColumn is in first merged range it will delete the merged cell and doesn't move the other merged cell range, as per the old code. This fix is applied at row.splice as this method is responsible for moving the cells when we call spliceColumns.
Related to source code (for typings update)
To fix the above issue I have filtered all the merged cells which start before the spliceColumn range and end after and also the merged cells which starts are ends after the column range (ignored the merged cells which starts and ends before the splice range as they don't get effected).
The above code will pull the mergedCells from the sheet. Then only in case of remove cells we iterate through the merged Cells and move them count range. When there is no insert I have added a logic to move the merged cells.
Also ignored the row.splice if the dest cell is merged with the following code
Other than the above rest of all are the format changes from prettier