File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Generated by ReScript, PLEASE EDIT WITH CARE
2
2
3
+ import * as Primitive_option from "rescript/lib/es6/Primitive_option.js" ;
3
4
4
5
function decodeGroup ( group ) {
5
6
let id = group . id ;
6
- if ( id === null ) {
7
+ if ( id == null ) {
7
8
return [
8
9
"e" ,
9
10
"f"
@@ -38,8 +39,22 @@ function decodeNull(x) {
38
39
}
39
40
}
40
41
42
+ function decodeUndefined ( x ) {
43
+ let match = x . field ;
44
+ if ( match === undefined ) {
45
+ return "no" ;
46
+ }
47
+ let tmp = Primitive_option . valFromOption ( match ) ;
48
+ if ( tmp === undefined ) {
49
+ return "yes it's undefined" ;
50
+ } else {
51
+ return "no" ;
52
+ }
53
+ }
54
+
41
55
export {
42
56
decodeGroup ,
43
57
decodeNull ,
58
+ decodeUndefined ,
44
59
}
45
60
/* No side effect */
Original file line number Diff line number Diff line change 2
2
type rec t =
3
3
| Boolean (bool )
4
4
| @as (null ) Null
5
+ | @as (undefined ) Undefined
5
6
| String (string )
6
7
| Number (float )
7
8
| Object (Dict .t <t >)
@@ -24,3 +25,9 @@ let decodeNull = x =>
24
25
| dict {"field" : Null } => "yes it's null"
25
26
| _ => "no"
26
27
}
28
+
29
+ let decodeUndefined = x =>
30
+ switch x {
31
+ | dict {"field" : Undefined } => "yes it's undefined"
32
+ | _ => "no"
33
+ }
You can’t perform that action at this time.
0 commit comments