aboutsummaryrefslogtreecommitdiff
path: root/src/RenameUtils.hs
blob: cdf36d2d62176682eca73e89c741fa2b3bceb5db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module RenameUtils where

import Data.List.Utils (startswith, replace)

typeFieldModifier :: String -> String
typeFieldModifier "type__" = "type"
typeFieldModifier "type___" = "type"
typeFieldModifier name = name

dotFieldModifier :: String -> String
dotFieldModifier = replace "__" "."

replaceUsername :: String -> String
replaceUsername "username" = "@username:localhost:8080"
replaceUsername name = name

replaceRoomId :: String -> String
replaceRoomId "slay" = "!slay:localhost:8080"
replaceRoomId name = name