@@ -6,7 +6,7 @@ import * as Primitive_array from "rescript/lib/es6/Primitive_array.js";
6
6
import * as Primitive_option from "rescript/lib/es6/Primitive_option.js" ;
7
7
8
8
function classify ( x ) {
9
- if ( x === "A" && typeof x !== "number" ) {
9
+ if ( x === "A" ) {
10
10
return "A" ;
11
11
} else if ( typeof x === "number" ) {
12
12
return "An integer" ;
@@ -24,7 +24,7 @@ function classify2(x) {
24
24
}
25
25
26
26
function cls ( x ) {
27
- if ( typeof x !== "object ") {
27
+ if ( x === "Two" || x === "One ") {
28
28
if ( x === "One" ) {
29
29
return "one" ;
30
30
} else {
@@ -40,13 +40,13 @@ let ListWithTuples = {};
40
40
let ListWithObjects = { } ;
41
41
42
42
function tuplesToObjects ( l ) {
43
- if ( Array . isArray ( l ) ) {
43
+ if ( l === undefined ) {
44
+ return null ;
45
+ } else {
44
46
return {
45
47
hd : l [ 0 ] ,
46
48
tl : tuplesToObjects ( l [ 1 ] )
47
49
} ;
48
- } else {
49
- return null ;
50
50
}
51
51
}
52
52
@@ -68,7 +68,7 @@ console.log("l1", l1);
68
68
console . log ( "l2" , l2 ) ;
69
69
70
70
function isTrue ( x ) {
71
- if ( typeof x !== "object" ) {
71
+ if ( x === true ) {
72
72
return true ;
73
73
} else {
74
74
return x . flag ;
@@ -80,7 +80,7 @@ let Truthy = {
80
80
} ;
81
81
82
82
function classify$1 ( x ) {
83
- if ( x === null || typeof x !== "object" ) {
83
+ if ( x === undefined || x === null ) {
84
84
if ( x === null ) {
85
85
return "null" ;
86
86
} else {
@@ -96,7 +96,7 @@ let TwoObjects = {
96
96
} ;
97
97
98
98
function classify$2 ( x ) {
99
- if ( x === "A " || x === "B " ) {
99
+ if ( x === "B " || x === "A " ) {
100
100
if ( x === "A" ) {
101
101
return "a" ;
102
102
} else {
@@ -112,7 +112,7 @@ let Unknown = {
112
112
} ;
113
113
114
114
function classify$3 ( x ) {
115
- if ( typeof x !== "object" && typeof x !== "number" && ( x === "C" || x === "B" || x === "A" || x === "D" ) ) {
115
+ if ( x === "D" || x === "C" || x === "B" || x === "A" ) {
116
116
switch ( x ) {
117
117
case "A" :
118
118
return "a" ;
@@ -173,7 +173,7 @@ let WithArray = {
173
173
} ;
174
174
175
175
function classify$6 ( x ) {
176
- if ( ! Array . isArray ( x ) && ( x === null || typeof x !== "object" ) && typeof x !== "number" && typeof x !== "string" ) {
176
+ if ( x === null || x === true || x === false ) {
177
177
switch ( x ) {
178
178
case false :
179
179
return "JSONFalse" ;
@@ -214,18 +214,18 @@ let Json = {
214
214
} ;
215
215
216
216
function check ( s , y ) {
217
- if ( ! Array . isArray ( s ) ) {
217
+ if ( s === "B" ) {
218
218
return 42 ;
219
219
}
220
220
let x = s [ 0 ] ;
221
- if ( ! Array . isArray ( x ) ) {
221
+ if ( x === "B" ) {
222
222
return 42 ;
223
223
}
224
224
let tmp = s [ 1 ] ;
225
- if ( Array . isArray ( tmp ) || x === y ) {
226
- return 42 ;
227
- } else {
225
+ if ( tmp === "B" && x !== y ) {
228
226
return 41 ;
227
+ } else {
228
+ return 42 ;
229
229
}
230
230
}
231
231
@@ -234,7 +234,7 @@ let TrickyNested = {
234
234
} ;
235
235
236
236
function checkEnum ( e ) {
237
- if ( ! ( e === "Two " || e === "One " || e === "Three " ) ) {
237
+ if ( ! ( e === "Three " || e === "Two " || e === "One " ) ) {
238
238
return "Something else..." + e ;
239
239
}
240
240
switch ( e ) {
@@ -252,7 +252,7 @@ let OverlapString = {
252
252
} ;
253
253
254
254
function checkEnum$1 ( e ) {
255
- if ( ! ( e === "Two " || e === 1.0 || e === "Three" ) ) {
255
+ if ( ! ( e === "Three " || e === "Two" || e === 1.0 ) ) {
256
256
return "Something else..." ;
257
257
}
258
258
switch ( e ) {
@@ -270,7 +270,7 @@ let OverlapNumber = {
270
270
} ;
271
271
272
272
function checkEnum$2 ( e ) {
273
- if ( ! ( e === null || typeof e !== "object" ) ) {
273
+ if ( ! ( e === "Three" || e === "Two" || e === null ) ) {
274
274
return "Object..." ;
275
275
}
276
276
switch ( e ) {
@@ -376,7 +376,7 @@ let TestFunctionCase = {
376
376
let someJson = '[{"name": "Haan"}, {"name": "Mr"}, false]' ;
377
377
378
378
function check$1 ( s ) {
379
- if ( ! Array . isArray ( s ) && ( s === null || typeof s !== "object" ) && typeof s !== "number" && typeof s !== "string" ) {
379
+ if ( s === null || s === true || s === false || s === undefined ) {
380
380
console . log ( "Nope..." ) ;
381
381
return ;
382
382
}
@@ -386,11 +386,11 @@ function check$1(s) {
386
386
return ;
387
387
}
388
388
let match = s [ 0 ] ;
389
- if ( match === true ) {
389
+ if ( ( match === null || match === true || match === false || match === undefined ) && match === true ) {
390
390
let match$1 = s [ 1 ] ;
391
- if ( match$1 === false ) {
391
+ if ( ( match$1 === null || match$1 === true || match$1 === false || match$1 === undefined ) && match$1 === false ) {
392
392
let match$2 = s [ 2 ] ;
393
- if ( ! Array . isArray ( match$2 ) && ( match$2 === null || typeof match$2 !== "object" ) && typeof match$2 !== "number" && typeof match$2 !== "string" ) {
393
+ if ( match$2 === null || match$2 === true || match$2 === false || match$2 === undefined ) {
394
394
console . log ( "Nope..." ) ;
395
395
return ;
396
396
}
@@ -400,13 +400,13 @@ function check$1(s) {
400
400
return ;
401
401
}
402
402
let match$3 = match$2 [ 0 ] ;
403
- if ( ! Array . isArray ( match$3 ) && ( match$3 === null || typeof match$3 !== "object" ) && typeof match$3 !== "number" && typeof match$3 !== "string" ) {
403
+ if ( match$3 === null || match$3 === true || match$3 === false || match$3 === undefined ) {
404
404
console . log ( "Nope..." ) ;
405
405
return ;
406
406
}
407
407
if ( typeof match$3 === "string" && match$3 === "My name is" ) {
408
408
let match$4 = match$2 [ 1 ] ;
409
- if ( ! Array . isArray ( match$4 ) && ( match$4 === null || typeof match$4 !== "object" ) && typeof match$4 !== "number" && typeof match$4 !== "string" ) {
409
+ if ( match$4 === null || match$4 === true || match$4 === false || match$4 === undefined ) {
410
410
console . log ( "Nope..." ) ;
411
411
return ;
412
412
}
@@ -476,7 +476,7 @@ let PromiseSync = {
476
476
} ;
477
477
478
478
async function classify$10 ( a ) {
479
- if ( typeof a !== "object" && ! ( a instanceof Promise ) && ( a === "test" || a === 12 ) && ! Array . isArray ( a ) ) {
479
+ if ( a === 12 || a === "test" ) {
480
480
if ( a === "test" ) {
481
481
console . log ( "testing" ) ;
482
482
return ;
0 commit comments