Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check for column content before replacing
- Loading branch information
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,8 +62,8 @@ export function getPrUpdatesTable(config: BranchConfig): string { | |
let val = '|'; | ||
for (const column of tableColumns) { | ||
const content = row[column] | ||
.replace(/^@/, '@​') | ||
.replace(/\|/g, '\\|'); | ||
? row[column].replace(/^@/, '@​').replace(/\|/g, '\\|') | ||
: ''; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
viceice
Member
|
||
val += ` ${content} |`; | ||
} | ||
val += '\n'; | ||
|
@rarkins This can be simplified to
row[column]?.replace(/^@/, '@​').replace(/\|/g, '\\|') ?? ''
🙃You should use
?.
operator more often 😅