We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 773551b commit 8dc62e1Copy full SHA for 8dc62e1
examples/cli/src/flags.ts
@@ -1,7 +1,8 @@
1
const possibleChains = [314159, 314] as const
2
type Chains = (typeof possibleChains)[number]
3
4
-const Chain = (chain: Chains) => {
+const Chain = (chainStr: string) => {
5
+ const chain = Number(chainStr) as Chains
6
if (!possibleChains.includes(chain)) {
7
throw new Error(
8
`Invalid chain: ${chain}. Must be one of: ${possibleChains.join(', ')}`
0 commit comments