yesod-routes-flow 1.0.2 → 1.1
raw patch · 2 files changed
+7/−5 lines, 2 files
Files
Yesod/Routes/Flow/Generator.hs view
@@ -53,12 +53,14 @@ | otherwise = c : go cs go [] = [] + isNumberType "Int" = True+ isNumberType type_ = "Id" `isSuffixOf` type_ -- UserId, PageId, PostId, etc.+ renderRoutePieces pieces = intercalate "/" $ map renderRoutePiece pieces renderRoutePiece p = case p of- Static st -> pack st :: Text- Dynamic "Text" -> ": string"- Dynamic "Int" -> ": number"- Dynamic _ -> ": string"+ Static st -> pack st :: Text+ Dynamic type_ | isNumberType type_ -> ": number"+ | otherwise -> ": string" isVariable r = length r > 1 && DT.head r == ':' resRoute res = renderRoutePieces $ resourcePieces res fullName res = intercalate "_" [pack st :: Text | Static st <- resourcePieces res]
yesod-routes-flow.cabal view
@@ -1,5 +1,5 @@ name: yesod-routes-flow-version: 1.0.2+version: 1.1 synopsis: Generate Flow routes for Yesod description: Parse the Yesod routes data structure and generate routes that can be used with Flow. homepage: https://github.com/frontrowed/yesod-routes-flow