Skip to content

Commit

Permalink
fix: rm list and table when none
Browse files Browse the repository at this point in the history
  • Loading branch information
DhairyaSethi committed Dec 6, 2023
1 parent 873833a commit 95297f6
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions generateMarkdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,10 @@ function generateDeploymentHistory(history, latest, chainId) {
Deployed contracts:
- ${contractInfos
${contractInfos.length > 1 ? `- `: ``}${contractInfos
.map(
({ contract, contractName }) => `
<details>
<summary><a href="${
({ contract, contractName }) => `${Object.keys(contract.input.constructor).length ? `<details>
<summary>`: ``}<a href="${
getEtherscanLink(chainId, contract.address) || contract.address
}">${contractName.replace(/([A-Z])/g, " $1").trim()}</a>${
contract.proxyType
Expand All @@ -268,15 +267,15 @@ function generateDeploymentHistory(history, latest, chainId) {
"tx",
)}">Initialization Txn</a>)`
: ``
}</summary>
${
}
${
Object.keys(contract.input.constructor).length
? `
? `</summary>
<table>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
<tr>
<th>Parameter</th>
<th>Value</th>
</tr>
${Object.entries(contract.input.constructor)
.map(
([key, value]) => `
Expand All @@ -298,10 +297,9 @@ function generateDeploymentHistory(history, latest, chainId) {
`
: ``
}
</details>
`,
${Object.keys(contract.input.constructor).length ? `</details>`: ``}`,
)
.join("\n- ")}
.join("\n - ")}
`,
)
.join("\n\n");
Expand Down

0 comments on commit 95297f6

Please sign in to comment.