{-# LANGUAGE OverloadedStrings #-} module Database.InfluxDB.Internal.Text ( escapeCommas , escapeEqualSigns , escapeSpaces , escapeDoubleQuotes , escapeSingleQuotes , escapeBackslashes ) where import Data.Text (Text) import qualified Data.Text as T escapeCommas , escapeEqualSigns , escapeSpaces , escapeDoubleQuotes , escapeSingleQuotes , escapeBackslashes :: Text -> Text escapeCommas :: Text -> Text escapeCommas = Text -> Text -> Text -> Text T.replace Text "," Text "\\," escapeEqualSigns :: Text -> Text escapeEqualSigns = Text -> Text -> Text -> Text T.replace Text "=" Text "\\=" escapeSpaces :: Text -> Text escapeSpaces = Text -> Text -> Text -> Text T.replace Text " " Text "\\ " escapeDoubleQuotes :: Text -> Text escapeDoubleQuotes = Text -> Text -> Text -> Text T.replace Text "\"" Text "\\\"" escapeSingleQuotes :: Text -> Text escapeSingleQuotes = Text -> Text -> Text -> Text T.replace Text "'" Text "\\'" escapeBackslashes :: Text -> Text escapeBackslashes = Text -> Text -> Text -> Text T.replace Text "\\" Text "\\\\"