Skip to content

Commit 19ba19f

Browse files
committed
use toEnum instead of fromCharCode
1 parent 6ff0144 commit 19ba19f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Node/FS/Perms.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ module Node.FS.Perms
1313
) where
1414

1515
import Prelude
16-
import Data.Char (fromCharCode)
16+
17+
import Data.Enum (toEnum)
1718
import Data.Int (fromNumber)
1819
import Data.Maybe (Maybe(..), isNothing, fromJust)
1920
import Data.String (Pattern(Pattern), toCharArray, joinWith, drop, charAt, indexOf)
@@ -119,7 +120,7 @@ instance showPerms :: Show Perms where
119120
permsFromString :: String -> Maybe Perms
120121
permsFromString = _perms <<< toCharArray <<< dropPrefix zeroChar
121122
where
122-
zeroChar = fromCharCode 48
123+
zeroChar = unsafePartial $ fromJust $ toEnum 48
123124

124125
dropPrefix x xs
125126
| charAt 0 xs == Just x = drop 1 xs

0 commit comments

Comments
 (0)