Skip to content

Commit 73d6823

Browse files
AlexaDeWitjacereda
authored andcommitted
Improve docs
1 parent a46da08 commit 73d6823

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Data/ArrayBuffer/ArrayBuffer.purs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ foreign import fromIntArray :: Array Int -> ArrayBuffer
3333
-- | Convert a string into an `ArrayBuffer` representation.
3434
foreign import fromString :: String -> ArrayBuffer
3535

36-
-- | Convert an ArrayBuffer into a string. Uses fromCharCode and thus does not support full utf-16
3736
foreign import decodeToStringImpl :: Fn3 (String -> Maybe String) (Maybe String) ArrayBuffer (Maybe String)
3837

38+
-- | Convert an ArrayBuffer into a string. Uses fromCharCode and thus does not support full utf-16
39+
-- | Is currently only defined for ArrayBuffers with even numbers of bytes, as it assumes the ArrayBuffer encodes string data.
40+
-- | For more general string-encoding forms of data, use a base64 or other encoding scheme.
3941
decodeToString :: ArrayBuffer -> Maybe String
4042
decodeToString = runFn3 decodeToStringImpl Just Nothing

0 commit comments

Comments
 (0)