forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs_null.js
49 lines (41 loc) · 736 Bytes
/
js_null.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict';
var Caml_option = require("./caml_option.js");
function test(x) {
return x === null;
}
function getExn(f) {
if (f !== null) {
return f;
} else {
throw new Error("Js.Null.getExn");
}
}
function bind(x, f) {
if (x !== null) {
return f(x);
} else {
return null;
}
}
function iter(x, f) {
if (x !== null) {
return f(x);
} else {
return /* () */0;
}
}
function fromOption(x) {
if (x !== undefined) {
return Caml_option.valFromOption(x);
} else {
return null;
}
}
var from_opt = fromOption;
exports.test = test;
exports.getExn = getExn;
exports.bind = bind;
exports.iter = iter;
exports.fromOption = fromOption;
exports.from_opt = from_opt;
/* No side effect */