module Data.JSString.Text
( textToJSString
, textFromJSString
, lazyTextToJSString
, lazyTextFromJSString
, textFromJSVal
, lazyTextFromJSVal
) where
import GHCJS.Prim
import Data.JSString.Internal.Type
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
textToJSString :: T.Text -> JSString
textToJSString = JSString
textFromJSString :: JSString -> T.Text
textFromJSString (JSString t) = t
lazyTextToJSString :: TL.Text -> JSString
lazyTextToJSString t = JSString $ TL.toStrict t
lazyTextFromJSString :: JSString -> TL.Text
lazyTextFromJSString (JSString t) = TL.fromStrict t
textFromJSVal :: JSVal -> T.Text
textFromJSVal _ = T.empty
lazyTextFromJSVal :: JSVal -> TL.Text
lazyTextFromJSVal _ = TL.empty