|
| 1 | +/* encoders to json for react-native */ |
1 | 2 | module Encoder = { |
2 | | - /** [string s] makes a JSON string of the [string] [s] */ |
3 | | - external string: string => Js.Json.t = "%identity"; /* [string s] makes a JSON string of the [string] [s] */ |
| 3 | + external string: string => Js.Json.t = "%identity"; |
4 | 4 |
|
5 | | - /** [float n] makes a JSON number of the [float] [n] */ |
6 | | - external float: float => Js.Json.t = "%identity"; /* [float n] makes a JSON number of the [float] [n] */ |
| 5 | + external float: float => Js.Json.t = "%identity"; |
7 | 6 |
|
8 | | - /** [int n] makes a JSON number of the [int] [n] */ |
9 | | - external int: int => Js.Json.t = "%identity"; /* [int n] makes a JSON number of the [int] [n] */ |
| 7 | + external int: int => Js.Json.t = "%identity"; |
10 | 8 |
|
11 | | - /** [boolean b] makes a JSON boolean of the [bool] [b] */ |
12 | | - external boolean: bool => Js.Json.t = "%identity"; /* [boolean b] makes a JSON boolean of the [bool] [b] */ |
| 9 | + external boolean: bool => Js.Json.t = "%identity"; |
13 | 10 |
|
14 | | - /** [object_ dict] makes a JSON objet of the [Js.Dict.t] [dict] */ |
15 | | - external object_: Js_dict.t(Js.Json.t) => Js.Json.t = "%identity"; /* [object_ dict] makes a JSON objet of the [Js.Dict.t] [dict] */ |
| 11 | + external object_: Js_dict.t(Js.Json.t) => Js.Json.t = "%identity"; |
16 | 12 |
|
17 | 13 | external array: array(Js.Json.t) => Js.Json.t = "%identity"; |
18 | 14 |
|
19 | 15 | external animatedValue: AnimatedRe.value('a) => Js.Json.t = "%identity"; |
20 | 16 |
|
21 | | - let pct = pct => string(Printf.sprintf("%.2f%%", pct)); |
| 17 | + let pct = f => string(Printf.sprintf("%.2f%%", f)); |
| 18 | + |
| 19 | + let deg = f => string(Printf.sprintf("%.2f%%", f) ++ "deg"); |
22 | 20 | }; |
0 commit comments