@@ -4,19 +4,38 @@ module Global.Unsafe where
44-- | to serialize functions returns undefined
55foreign import unsafeStringify :: forall a . a -> String
66
7- -- | Formats Number as a String with limited number of digits after the dot
7+ -- | Formats Number as a String with limited number of digits after the dot.
8+ -- |
89-- | May throw RangeError if the number of digits is not within the allowed range
910-- | (standard precision range is 0 to 20, but implementations may change it)
1011foreign import unsafeToFixed :: Int -> Number -> String
1112
1213-- | Formats Number as String in exponential notation limiting number of digits
13- -- | after the decimal dot.
14+ -- | after the decimal dot.
15+ -- |
1416-- | May throw RangeError if the number of digits is not within the allowed range
1517-- | (standard precision range is 0 to 20, but implementations may change it)
1618foreign import unsafeToExponential :: Int -> Number -> String
1719
18- -- | Formats Number as String in fixed-point or exponential notation rounded
20+ -- | Formats Number as String in fixed-point or exponential notation rounded
1921-- | to specified number of significant digits.
22+ -- |
2023-- | May throw RangeError if the number of digits is not within the allowed range
2124-- | (standard precision range is 0 to 100, but implementations may change it)
2225foreign import unsafeToPrecision :: Int -> Number -> String
26+
27+ -- | URI decoding. May throw a `URIError` if given a value with undecodeable
28+ -- | escape sequences.
29+ foreign import unsafeDecodeURI :: String -> String
30+
31+ -- | URI encoding. May throw a `URIError` if given a value with unencodeable
32+ -- | characters.
33+ foreign import unsafeEncodeURI :: String -> String
34+
35+ -- | URI component decoding. May throw a `URIError` if given a value with
36+ -- | undecodeable escape sequences.
37+ foreign import unsafeDecodeURIComponent :: String -> String
38+
39+ -- | URI component encoding. May throw a `URIError` if given a value with
40+ -- | unencodeable characters.
41+ foreign import unsafeEncodeURIComponent :: String -> String
0 commit comments