conditional JSON options for iOS/Android (#318)

* conditional JSON options for iOS/Android

* update cabal file
This commit is contained in:
Evgeny Poberezkin
2022-02-16 08:58:35 +00:00
committed by GitHub
parent 229e2607d7
commit 137afb68fe
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -27,6 +27,9 @@ extra-source-files:
README.md
CHANGELOG.md
if (os(android))
ghc-option: -DANDROID
library
exposed-modules:
Simplex.Messaging.Agent
+5
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
@@ -97,7 +98,11 @@ enumJSON tagModifier =
}
sumTypeJSON :: (String -> String) -> J.Options
#if defined(ANDROID)
sumTypeJSON = taggedObjectJSON
#else
sumTypeJSON = singleFieldJSON
#endif
taggedObjectJSON :: (String -> String) -> J.Options
taggedObjectJSON tagModifier =