Skip to content

Commit 94f5939

Browse files
authored
Merge pull request #2741 from arnarthor/master
Add fromStringWithEncoding and toString to Node_buffer
2 parents a54ea03 + 5077936 commit 94f5939

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jscomp/others/node_buffer.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ external isBuffer : 'a -> bool = "Buffer.isBuffer"
3131

3232
external fromString : string -> t = "Buffer.from"
3333
[@@bs.val]
34+
35+
external fromStringWithEncoding : string -> ([ `ascii | `utf8 | `utf16le | `usc2 | `base64 | `latin1 | `binary | `hex ] [@bs.string]) -> t = "from"
36+
[@@bs.val] [@@bs.scope "Buffer"]
37+
38+
external toString : t -> string = ""
39+
[@@bs.send] [@@bs.scope "Buffer"]

0 commit comments

Comments
 (0)