String.purs 540 Bytes
Newer Older
1 2
module Gargantext.Utils.String where

3 4
import Prelude

5
import Data.Function.Uncurried (Fn1, runFn1)
6 7
import Data.Int as Int
import Data.Number.Format as DNF
8 9

foreign import _btoa :: Fn1 String String
10
foreign import _specialCharNormalize :: Fn1 String String
11 12 13

btoa :: String -> String
btoa = runFn1 _btoa
14 15 16

intToString :: Int -> String
intToString = DNF.toString <<< Int.toNumber
17 18 19 20

-- | https://ricardometring.com/javascript-replace-special-characters
specialCharNormalize :: String -> String
specialCharNormalize = runFn1 _specialCharNormalize