-
Notifications
You must be signed in to change notification settings - Fork 483
Expand file tree
/
Copy pathStdlibMigration_Js_Undefined.res.expected
More file actions
36 lines (24 loc) · 1.21 KB
/
StdlibMigration_Js_Undefined.res.expected
File metadata and controls
36 lines (24 loc) · 1.21 KB
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
let make1 = "hello"->Nullable.make
let make2 = Nullable.make("hello")
let empty1 = Nullable.undefined
let getUnsafe1 = Nullable.make(1)->Nullable.getUnsafe
let getUnsafe2 = Nullable.getUnsafe(Nullable.make(1))
let getExn1 = Nullable.make(1)->Nullable.getOrThrow
let getExn2 = Nullable.getOrThrow(Nullable.make(1))
let map1 = Nullable.make(2)->Nullable.map(x => x + 1)
let map2 = Nullable.map(Nullable.make(2), x => x + 1)
let forEach1 = Nullable.make(2)->Nullable.forEach(x => ignore(x))
let forEach2 = Nullable.forEach(Nullable.make(2), x => ignore(x))
let fromOption1 = Some("x")->Nullable.fromOption
let fromOption2 = Nullable.fromOption(None)
let from_opt1 = Some("y")->Nullable.fromOption
let from_opt2 = Nullable.fromOption(None)
let toOption1 = Nullable.make(3)->Nullable.toOption
let toOption2 = Nullable.toOption(Nullable.make(3))
let to_opt1 = Nullable.make(4)->Nullable.toOption
let to_opt2 = Nullable.toOption(Nullable.make(4))
let test1 = Nullable.undefined->Js.Undefined.test
let test2 = Js.Undefined.test(Nullable.undefined)
let test3 = Nullable.make(5)->Nullable.map(v => v)->Js.Undefined.test
let testAny1 = Js.Undefined.testAny(Nullable.undefined)
let testAny2 = Nullable.undefined->Js.Undefined.testAny