Skip to content

Commit

Permalink
Fix bug in getDeclarationName
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Dec 1, 2023
1 parent 07bc492 commit 5afd164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/Aeson/TypeScript/Formatting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ formatTSDeclarations' options allDeclarations =
getDeclarationName :: TSDeclaration -> Maybe String
getDeclarationName (TSInterfaceDeclaration {..}) = Just interfaceName
getDeclarationName (TSTypeAlternatives {..}) = Just typeName
_ = Nothing
getDeclarationName _ = Nothing

removeReferencesToRemovedNames :: [String] -> TSDeclaration -> TSDeclaration
removeReferencesToRemovedNames removedNames decl@(TSTypeAlternatives {..}) = decl { alternativeTypes = [x | x <- alternativeTypes, not (x `L.elem` removedNames)] }
Expand Down

0 comments on commit 5afd164

Please sign in to comment.