From 7d6d8b4b61deefe6ad1995eff5f2be746977d953 Mon Sep 17 00:00:00 2001 From: Alan Soares Date: Wed, 14 Feb 2024 17:13:48 +1300 Subject: [PATCH] fix: use correct case conversion --- cli/wizard/commands/list-squid-token/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/wizard/commands/list-squid-token/index.ts b/cli/wizard/commands/list-squid-token/index.ts index 1dc2fc4..908c0aa 100644 --- a/cli/wizard/commands/list-squid-token/index.ts +++ b/cli/wizard/commands/list-squid-token/index.ts @@ -203,7 +203,7 @@ function parseAsInterchainTokenConfig( axelarChainId: data.axelarChainId, tokenAddress: address.parse(data.tokenAddress), tokenManager: address.parse(data.tokenManagerAddress), - tokenManagerType: convertToCamelCase(data.tokenManagerType), + tokenManagerType: snakeToCamelCase(data.tokenManagerType), }, ], ...data.remoteTokens.map((token) => ({ @@ -212,7 +212,7 @@ function parseAsInterchainTokenConfig( axelarChainId: token.axelarChainId, tokenAddress: address.parse(token.tokenAddress), tokenManager: address.parse(token.tokenManagerAddress), - tokenManagerType: convertToCamelCase(token.tokenManagerType), + tokenManagerType: snakeToCamelCase(token.tokenManagerType), })), ], }; @@ -222,6 +222,4 @@ function getEnvironmentFromUrl(tokenDetailsUrl: string) { return tokenDetailsUrl?.includes("testnet") ? "testnet" : "mainnet"; } -function convertToCamelCase(input: string) { - return convertCase("CONSTANT_CASE", "camelCase")(input ?? "unknown"); -} +const snakeToCamelCase = convertCase("snake_case", "camelCase");