Skip to content

Commit

Permalink
fix: use correct case conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrsoares committed Feb 14, 2024
1 parent 3d4402a commit 7d6d8b4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cli/wizard/commands/list-squid-token/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand All @@ -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),
})),
],
};
Expand All @@ -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");

0 comments on commit 7d6d8b4

Please sign in to comment.