Skip to content

Commit 1b6d8d9

Browse files
author
github-actions[bot]
committed
Update API docs for v12.0.0-alpha.15
1 parent 659a0e2 commit 1b6d8d9

File tree

2 files changed

+321
-82
lines changed

2 files changed

+321
-82
lines changed

data/api/v12.0.0/belt.json

Lines changed: 190 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,13 @@
940940
"docstrings": [],
941941
"signature": "let getExn: (t<'a>, key) => 'a"
942942
},
943+
{
944+
"id": "Belt.MutableMap.String.getOrThrow",
945+
"kind": "value",
946+
"name": "getOrThrow",
947+
"docstrings": [],
948+
"signature": "let getOrThrow: (t<'a>, key) => 'a"
949+
},
943950
{
944951
"id": "Belt.MutableMap.String.checkInvariantInternal",
945952
"kind": "value",
@@ -1302,6 +1309,13 @@
13021309
"docstrings": [],
13031310
"signature": "let getExn: (t<'a>, key) => 'a"
13041311
},
1312+
{
1313+
"id": "Belt.MutableMap.Int.getOrThrow",
1314+
"kind": "value",
1315+
"name": "getOrThrow",
1316+
"docstrings": [],
1317+
"signature": "let getOrThrow: (t<'a>, key) => 'a"
1318+
},
13051319
{
13061320
"id": "Belt.MutableMap.Int.checkInvariantInternal",
13071321
"kind": "value",
@@ -1713,6 +1727,13 @@
17131727
"docstrings": [],
17141728
"signature": "let getExn: (t, value) => value"
17151729
},
1730+
{
1731+
"id": "Belt.MutableSet.String.getOrThrow",
1732+
"kind": "value",
1733+
"name": "getOrThrow",
1734+
"docstrings": [],
1735+
"signature": "let getOrThrow: (t, value) => value"
1736+
},
17161737
{
17171738
"id": "Belt.MutableSet.String.split",
17181739
"kind": "value",
@@ -2061,6 +2082,13 @@
20612082
"docstrings": [],
20622083
"signature": "let getExn: (t, value) => value"
20632084
},
2085+
{
2086+
"id": "Belt.MutableSet.Int.getOrThrow",
2087+
"kind": "value",
2088+
"name": "getOrThrow",
2089+
"docstrings": [],
2090+
"signature": "let getOrThrow: (t, value) => value"
2091+
},
20642092
{
20652093
"id": "Belt.MutableSet.Int.split",
20662094
"kind": "value",
@@ -2368,6 +2396,13 @@
23682396
"docstrings": [],
23692397
"signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a"
23702398
},
2399+
{
2400+
"id": "Belt.Map.Dict.getOrThrow",
2401+
"kind": "value",
2402+
"name": "getOrThrow",
2403+
"docstrings": [],
2404+
"signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a"
2405+
},
23712406
{
23722407
"id": "Belt.Map.Dict.checkInvariantInternal",
23732408
"kind": "value",
@@ -2803,6 +2838,13 @@
28032838
"docstrings": [],
28042839
"signature": "let getExn: (t<'v>, key) => 'v"
28052840
},
2841+
{
2842+
"id": "Belt.Map.String.getOrThrow",
2843+
"kind": "value",
2844+
"name": "getOrThrow",
2845+
"docstrings": [],
2846+
"signature": "let getOrThrow: (t<'v>, key) => 'v"
2847+
},
28062848
{
28072849
"id": "Belt.Map.String.checkInvariantInternal",
28082850
"kind": "value",
@@ -3242,6 +3284,13 @@
32423284
"docstrings": [],
32433285
"signature": "let getExn: (t<'v>, key) => 'v"
32443286
},
3287+
{
3288+
"id": "Belt.Map.Int.getOrThrow",
3289+
"kind": "value",
3290+
"name": "getOrThrow",
3291+
"docstrings": [],
3292+
"signature": "let getOrThrow: (t<'v>, key) => 'v"
3293+
},
32453294
{
32463295
"id": "Belt.Map.Int.checkInvariantInternal",
32473296
"kind": "value",
@@ -3747,6 +3796,15 @@
37473796
],
37483797
"signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value"
37493798
},
3799+
{
3800+
"id": "Belt.Set.Dict.getOrThrow",
3801+
"kind": "value",
3802+
"name": "getOrThrow",
3803+
"docstrings": [
3804+
"Same as [get](#get) but raise when element does not exist."
3805+
],
3806+
"signature": "let getOrThrow: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value"
3807+
},
37503808
{
37513809
"id": "Belt.Set.Dict.split",
37523810
"kind": "value",
@@ -4082,6 +4140,13 @@
40824140
"docstrings": [],
40834141
"signature": "let getExn: (t, value) => value"
40844142
},
4143+
{
4144+
"id": "Belt.Set.String.getOrThrow",
4145+
"kind": "value",
4146+
"name": "getOrThrow",
4147+
"docstrings": [],
4148+
"signature": "let getOrThrow: (t, value) => value"
4149+
},
40854150
{
40864151
"id": "Belt.Set.String.split",
40874152
"kind": "value",
@@ -4417,6 +4482,13 @@
44174482
"docstrings": [],
44184483
"signature": "let getExn: (t, value) => value"
44194484
},
4485+
{
4486+
"id": "Belt.Set.Int.getOrThrow",
4487+
"kind": "value",
4488+
"name": "getOrThrow",
4489+
"docstrings": [],
4490+
"signature": "let getOrThrow: (t, value) => value"
4491+
},
44204492
{
44214493
"id": "Belt.Set.Int.split",
44224494
"kind": "value",
@@ -4921,6 +4993,15 @@
49214993
],
49224994
"signature": "let getExn: t<'a, 'b> => 'a"
49234995
},
4996+
{
4997+
"id": "Belt.Result.getOrThrow",
4998+
"kind": "value",
4999+
"name": "getOrThrow",
5000+
"docstrings": [
5001+
"`getOrThrow(res)`: when `res` is `Ok(n)`, returns `n` when `res` is `Error(m)`, raise an exception\n\n## Examples\n\n```rescript\nBelt.Result.Ok(42)\n->Belt.Result.getOrThrow\n->assertEqual(42)\n\n\nswitch Belt.Result.getOrThrow(Belt.Result.Error(\"Invalid data\")) { // raise a exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
5002+
],
5003+
"signature": "let getOrThrow: t<'a, 'b> => 'a"
5004+
},
49245005
{
49255006
"id": "Belt.Result.mapWithDefaultU",
49265007
"kind": "value",
@@ -5090,6 +5171,15 @@
50905171
],
50915172
"signature": "let getExn: option<'a> => 'a"
50925173
},
5174+
{
5175+
"id": "Belt.Option.getOrThrow",
5176+
"kind": "value",
5177+
"name": "getOrThrow",
5178+
"docstrings": [
5179+
"Raises an Error in case `None` is provided. Use with care.\n\n## Examples\n\n```rescript\nSome(3)\n->Belt.Option.getOrThrow\n->assertEqual(3)\n\nswitch Belt.Option.getOrThrow(None) { // Raises an exception\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
5180+
],
5181+
"signature": "let getOrThrow: option<'a> => 'a"
5182+
},
50935183
{
50945184
"id": "Belt.Option.getUnsafe",
50955185
"kind": "value",
@@ -5889,6 +5979,13 @@
58895979
"docstrings": [],
58905980
"signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a"
58915981
},
5982+
{
5983+
"id": "Belt.MutableMap.getOrThrow",
5984+
"kind": "value",
5985+
"name": "getOrThrow",
5986+
"docstrings": [],
5987+
"signature": "let getOrThrow: (t<'k, 'a, 'id>, 'k) => 'a"
5988+
},
58925989
{
58935990
"id": "Belt.MutableMap.checkInvariantInternal",
58945991
"kind": "value",
@@ -6357,6 +6454,15 @@
63576454
],
63586455
"signature": "let getExn: (t<'value, 'id>, 'value) => 'value"
63596456
},
6457+
{
6458+
"id": "Belt.MutableSet.getOrThrow",
6459+
"kind": "value",
6460+
"name": "getOrThrow",
6461+
"docstrings": [
6462+
"Same as `Belt.MutableSet.get` but raise when element does not exist."
6463+
],
6464+
"signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value"
6465+
},
63606466
{
63616467
"id": "Belt.MutableSet.split",
63626468
"kind": "value",
@@ -6707,10 +6813,19 @@
67076813
"kind": "value",
67086814
"name": "getExn",
67096815
"docstrings": [
6710-
"`getExn(s, k)`\n\nSee `Belt.Map.getExn`\n\nraise when `k` not exist"
6816+
"`getExn(s, k)`\n\nSee `Belt.Map.get`\n\nraise when `k` not exist"
67116817
],
67126818
"signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v"
67136819
},
6820+
{
6821+
"id": "Belt.Map.getOrThrow",
6822+
"kind": "value",
6823+
"name": "getOrThrow",
6824+
"docstrings": [
6825+
"`getOrThrow(s, k)`\n\nSee `Belt.Map.get`\n\nraise when `k` not exist"
6826+
],
6827+
"signature": "let getOrThrow: (t<'k, 'v, 'id>, 'k) => 'v"
6828+
},
67146829
{
67156830
"id": "Belt.Map.remove",
67166831
"kind": "value",
@@ -7251,6 +7366,15 @@
72517366
],
72527367
"signature": "let getExn: (t<'value, 'id>, 'value) => 'value"
72537368
},
7369+
{
7370+
"id": "Belt.Set.getOrThrow",
7371+
"kind": "value",
7372+
"name": "getOrThrow",
7373+
"docstrings": [
7374+
"Same as [get](#get) but raise when element does not exist."
7375+
],
7376+
"signature": "let getOrThrow: (t<'value, 'id>, 'value) => 'value"
7377+
},
72547378
{
72557379
"id": "Belt.Set.split",
72567380
"kind": "value",
@@ -7446,6 +7570,15 @@
74467570
],
74477571
"signature": "let headExn: t<'a> => 'a"
74487572
},
7573+
{
7574+
"id": "Belt.List.headOrThrow",
7575+
"kind": "value",
7576+
"name": "headOrThrow",
7577+
"docstrings": [
7578+
"Same as `Belt.List.head` but raises an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.headOrThrow(list{1, 2, 3})->assertEqual(1)\n\nswitch Belt.List.headOrThrow(list{}) { // Raises an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
7579+
],
7580+
"signature": "let headOrThrow: t<'a> => 'a"
7581+
},
74497582
{
74507583
"id": "Belt.List.tail",
74517584
"kind": "value",
@@ -7464,6 +7597,15 @@
74647597
],
74657598
"signature": "let tailExn: t<'a> => t<'a>"
74667599
},
7600+
{
7601+
"id": "Belt.List.tailOrThrow",
7602+
"kind": "value",
7603+
"name": "tailOrThrow",
7604+
"docstrings": [
7605+
"Same as `Belt.List.tail` but raises an exception if `someList` is empty. Use\nwith care.\n\n## Examples\n\n```rescript\nBelt.List.tailOrThrow(list{1, 2, 3})->assertEqual(list{2, 3})\n\nswitch Belt.List.tailOrThrow(list{}) { // Raises an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
7606+
],
7607+
"signature": "let tailOrThrow: t<'a> => t<'a>"
7608+
},
74677609
{
74687610
"id": "Belt.List.add",
74697611
"kind": "value",
@@ -7491,6 +7633,15 @@
74917633
],
74927634
"signature": "let getExn: (t<'a>, int) => 'a"
74937635
},
7636+
{
7637+
"id": "Belt.List.getOrThrow",
7638+
"kind": "value",
7639+
"name": "getOrThrow",
7640+
"docstrings": [
7641+
"Same as `Belt.List.get` but raises an exception if `index` is larger than the\nlength. Use with care.\n\n## Examples\n\n```rescript\nlet abc = list{\"A\", \"B\", \"C\"}\n\nabc->Belt.List.getOrThrow(1)->assertEqual(\"B\")\n\nswitch abc->Belt.List.getOrThrow(4) { // Raises an Error\n| exception _ => assert(true)\n| _ => assert(false)\n}\n```"
7642+
],
7643+
"signature": "let getOrThrow: (t<'a>, int) => 'a"
7644+
},
74947645
{
74957646
"id": "Belt.List.make",
74967647
"kind": "value",
@@ -8447,10 +8598,19 @@
84478598
"kind": "value",
84488599
"name": "peekExn",
84498600
"docstrings": [
8450-
"raise an exception if `q` is empty"
8601+
"`peekExn(q)` raises an exception if `q` is empty."
84518602
],
84528603
"signature": "let peekExn: t<'a> => 'a"
84538604
},
8605+
{
8606+
"id": "Belt.MutableQueue.peekOrThrow",
8607+
"kind": "value",
8608+
"name": "peekOrThrow",
8609+
"docstrings": [
8610+
"`peekOrThrow(q)` raises an exception if `q` is empty."
8611+
],
8612+
"signature": "let peekOrThrow: t<'a> => 'a"
8613+
},
84548614
{
84558615
"id": "Belt.MutableQueue.pop",
84568616
"kind": "value",
@@ -8478,6 +8638,15 @@
84788638
],
84798639
"signature": "let popExn: t<'a> => 'a"
84808640
},
8641+
{
8642+
"id": "Belt.MutableQueue.popOrThrow",
8643+
"kind": "value",
8644+
"name": "popOrThrow",
8645+
"docstrings": [
8646+
"`popOrThrow(q)` raise an exception if q is empty."
8647+
],
8648+
"signature": "let popOrThrow: t<'a> => 'a"
8649+
},
84818650
{
84828651
"id": "Belt.MutableQueue.copy",
84838652
"kind": "value",
@@ -8712,7 +8881,7 @@
87128881
"name": "Array",
87138882
"docstrings": [
87148883
"[`Belt.Array`]()\n\n **mutable array**: Utilities functions",
8715-
"Utilities for `Array` functions.\n\n### Note about index syntax\n\nCode like `arr[0]` does *not* compile to JavaScript `arr[0]`. Reason transforms\nthe `[]` index syntax into a function: `Array.get(arr, 0)`. By default, this\nuses the default standard library's `Array.get` function, which may raise an\nexception if the index isn't found. If you `open Belt`, it will use the\n`Belt.Array.get` function which returns options instead of raising exceptions. \n[See this for more information](../belt.mdx#array-access-runtime-safety)."
8884+
"Utilities for `Array` functions."
87168885
],
87178886
"items": [
87188887
{
@@ -8758,6 +8927,15 @@
87588927
],
87598928
"signature": "let getExn: (t<'a>, int) => 'a"
87608929
},
8930+
{
8931+
"id": "Belt.Array.getOrThrow",
8932+
"kind": "value",
8933+
"name": "getOrThrow",
8934+
"docstrings": [
8935+
"Raise an exception if `i` is out of range.\nOtherwise return the value at index `i` in `arr`."
8936+
],
8937+
"signature": "let getOrThrow: (t<'a>, int) => 'a"
8938+
},
87618939
{
87628940
"id": "Belt.Array.getUnsafe",
87638941
"kind": "value",
@@ -8794,6 +8972,15 @@
87948972
],
87958973
"signature": "let setExn: (t<'a>, int, 'a) => unit"
87968974
},
8975+
{
8976+
"id": "Belt.Array.setOrThrow",
8977+
"kind": "value",
8978+
"name": "setOrThrow",
8979+
"docstrings": [
8980+
"`setOrThrow(arr, i, x)` raise an exception if `i` is out of range."
8981+
],
8982+
"signature": "let setOrThrow: (t<'a>, int, 'a) => unit"
8983+
},
87978984
{
87988985
"id": "Belt.Array.setUnsafe",
87998986
"kind": "value",

0 commit comments

Comments
 (0)