Skip to content

Commit 57f8e4f

Browse files
committed
apply redundant bs.string warning
1 parent 83319d8 commit 57f8e4f

File tree

11 files changed

+1663
-1670
lines changed

11 files changed

+1663
-1670
lines changed

jscomp/main/builtin_cmi_datasets.ml

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

jscomp/others/node_buffer.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ external isBuffer : 'a -> bool = "Buffer.isBuffer"
3232
external fromString : string -> t = "Buffer.from"
3333
[@@bs.val]
3434

35-
external fromStringWithEncoding : string -> ([ `ascii | `utf8 | `utf16le | `usc2 | `base64 | `latin1 | `binary | `hex ] [@bs.string]) -> t = "from"
35+
type encoding =
36+
[ `ascii | `utf8 | `utf16le | `usc2 | `base64 | `latin1 | `binary | `hex ]
37+
external fromStringWithEncoding : string -> encoding -> t = "from"
3638
[@@bs.val] [@@bs.scope "Buffer"]
3739

3840
external toString : t -> string = "toString"
3941
[@@bs.send]
4042

41-
external toStringWithEncoding : t -> ([ `ascii | `utf8 | `utf16le | `usc2 | `base64 | `latin1 | `binary | `hex ] [@bs.string]) -> string = "toString"
43+
external toStringWithEncoding : t -> encoding -> string = "toString"
4244
[@@bs.send]
4345

4446
external concat : t array -> t = "Buffer.concat"

jscomp/others/node_fs.ml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,20 @@ external openSync :
120120
] [@bs.string]) ->
121121
unit = "openSync" [@@bs.module "fs"]
122122

123-
123+
type encoding =
124+
[
125+
`hex
126+
| `utf8
127+
| `ascii
128+
| `latin1
129+
| `base64
130+
| `ucs2
131+
| `base64
132+
| `binary
133+
| `utf16le ]
124134
external readFileSync :
125135
string ->
126-
(
127-
[
128-
`hex
129-
| `utf8
130-
| `ascii
131-
| `latin1
132-
| `base64
133-
| `ucs2
134-
| `base64
135-
| `binary
136-
| `utf16le ][@bs.string]) ->
136+
encoding ->
137137
string = "readFileSync"
138138
[@@bs.val] [@@bs.module "fs"]
139139

@@ -148,16 +148,7 @@ external existsSync : string -> bool = "existsSync"
148148
external writeFileSync :
149149
string ->
150150
string ->
151-
(
152-
[ `hex
153-
| `utf8
154-
| `ascii
155-
| `latin1
156-
| `base64
157-
| `ucs2
158-
| `base64
159-
| `binary
160-
| `utf16le ][@bs.string]) ->
151+
encoding ->
161152
unit = "writeFileSync"
162153
[@@bs.val] [@@bs.module "fs"]
163154

0 commit comments

Comments
 (0)