From ca6bc15b55f820c0c6b5b16399fa1e86e7abbd0e Mon Sep 17 00:00:00 2001 From: Ross MacLeod Date: Fri, 22 Mar 2024 19:58:22 +0000 Subject: [PATCH] fix #44: apply interfaceNameModifier to whole interface name, not just tail --- src/Data/Aeson/TypeScript/Formatting.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Aeson/TypeScript/Formatting.hs b/src/Data/Aeson/TypeScript/Formatting.hs index 9412b53..edf6913 100644 --- a/src/Data/Aeson/TypeScript/Formatting.hs +++ b/src/Data/Aeson/TypeScript/Formatting.hs @@ -57,7 +57,7 @@ formatTSDeclaration (FormattingOptions {..}) (TSInterfaceDeclaration interfaceNa #{ls} }|] where ls = T.intercalate "\n" $ [indentTo numIndentSpaces (T.pack (formatTSField member <> ";")) | member <- members] - modifiedInterfaceName = (\(li, name) -> li <> interfaceNameModifier name) . splitAt 1 $ interfaceName + modifiedInterfaceName = interfaceNameModifier interfaceName formatTSField :: TSField -> String formatTSField (TSField optional name typ maybeDoc') = makeDocPrefix maybeDoc' <> [i|#{name}#{if optional then ("?" :: String) else ""}: #{typ}|]