File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 11// Generated by ReScript, PLEASE EDIT WITH CARE
22
3+ import * as Primitive_option from "rescript/lib/es6/Primitive_option.js" ;
34
45function decodeGroup ( group ) {
56 let id = group . id ;
6- if ( id === null ) {
7+ if ( id == null ) {
78 return [
89 "e" ,
910 "f"
@@ -38,8 +39,22 @@ function decodeNull(x) {
3839 }
3940}
4041
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+
4155export {
4256 decodeGroup ,
4357 decodeNull ,
58+ decodeUndefined ,
4459}
4560/* No side effect */
Original file line number Diff line number Diff line change 22type rec t =
33 | Boolean (bool )
44 | @as (null ) Null
5+ | @as (undefined ) Undefined
56 | String (string )
67 | Number (float )
78 | Object (Dict .t <t >)
@@ -24,3 +25,9 @@ let decodeNull = x =>
2425 | dict {"field" : Null } => "yes it's null"
2526 | _ => "no"
2627 }
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