Skip to content

Commit

Permalink
refactor(formatObjectToTsLiteral): remove redundant conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
NguyenTuanCanh committed Nov 1, 2023
1 parent 471ab2d commit e965044
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,8 @@ enum LayerType {
const _formatObjectToTsLiteral = (obj: ChainConfigMap): string => {
const formatValue = (value: ChainConfig): string => {
if (typeof value === 'string') {
if (typeof value === 'string') {
if (Object.values(LayerType).includes(value as LayerType)) {
return `LayerType.${value}`; // This line is using LayerType as an enum, but it is now a type
}
return `"${value}"`;
if (Object.values(LayerType).includes(value as LayerType)) {
return `LayerType.${value}`; // This line is using LayerType as an enum, but it is now a type
}
return `"${value}"`;
}
Expand Down

0 comments on commit e965044

Please sign in to comment.