Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunnini committed Dec 20, 2024
1 parent e85c0a7 commit 4575b3d
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,20 @@ const EthExecuteContractTxPretty: React.FunctionComponent<{
.replace(/([-_][a-z])/g, (group) =>
group.toUpperCase().replace("-", "").replace("_", "")
)
.replace(/([A-Z])/g, " $1");
.replace(
/([a-z])([A-Z]+(?=[A-Z][a-z]|$))|([A-Z][a-z])/g,
(match, lower, acronym, normalWord) => {
if (acronym) {
return `${lower} ${acronym}`;
}
if (normalWord) {
return ` ${normalWord}`;
}
return match;
}
)
.replace(/\s+/g, " ") // 불필요한 공백 제거
.trim();

return (
<React.Fragment>
Expand Down

0 comments on commit 4575b3d

Please sign in to comment.