Skip to content

Commit

Permalink
feat: allow array without quotes
Browse files Browse the repository at this point in the history
e.g. [0x309c15a655F8F1Ab860F3Ad81A233e8BCaDb300E, 0x309c15a655F8F1Ab860F3Ad81A233e8BCaDb300E]
  • Loading branch information
Keith-CY committed May 21, 2023
1 parent b84c744 commit 3deada1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/ContractInfo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ const ContractInfo: React.FC<{ address: string; contract: PolyjuiceContractProps
try {
return JSON.parse(p.value)
} catch {
return p.value.split(',').map(v => v.trim())
return p.value
.replace(/(\[|\])/g, '')
.split(',')
.map(v => v.trim())
}
}
return p.value
Expand Down

0 comments on commit 3deada1

Please sign in to comment.