influxdb-0.0.0: src/Database/InfluxDB/Types/Internal.hs
module Database.InfluxDB.Types.Internal
( stripPrefixOptions
) where
import Data.Char (toLower)
import Data.Aeson.TH
stripPrefixOptions :: String -> Options
stripPrefixOptions name = defaultOptions
{ fieldLabelModifier = modifier
}
where
modifier xs = case drop (length name) xs of
[] -> error "Insufficient length of field name"
c:cs -> toLower c:cs