Skip to content

Commit

Permalink
fix codedownio#44: apply interfaceNameModifier to whole interface nam…
Browse files Browse the repository at this point in the history
…e, not just tail
  • Loading branch information
Ross MacLeod committed Mar 22, 2024
1 parent 1ea2172 commit ca6bc15
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 @@ -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}|]
Expand Down

0 comments on commit ca6bc15

Please sign in to comment.