{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
#ifdef ghcjs_HOST_OS
{-# OPTIONS_GHC -Wno-dodgy-imports #-}
#endif
module Language.Javascript.JSaddle.String (
JSString
, textFromJSString
, textToJSString
, strToText
, textToStr
) where
import Data.Text (Text)
import Language.Javascript.JSaddle.Types (JSString(..))
#ifdef ghcjs_HOST_OS
import Data.JSString.Text (textFromJSString, textToJSString)
#endif
#ifndef ghcjs_HOST_OS
textFromJSString :: JSString -> Text
textFromJSString (JSString text) = text
textToJSString :: Text -> JSString
textToJSString = JSString
#endif
strToText :: JSString -> Text
strToText = textFromJSString
textToStr :: Text -> JSString
textToStr = textToJSString