|
940 | 940 | "docstrings": [],
|
941 | 941 | "signature": "let getExn: (t<'a>, key) => 'a"
|
942 | 942 | },
|
| 943 | + { |
| 944 | + "id": "Belt.MutableMap.String.getOrThrow", |
| 945 | + "kind": "value", |
| 946 | + "name": "getOrThrow", |
| 947 | + "docstrings": [], |
| 948 | + "signature": "let getOrThrow: (t<'a>, key) => 'a" |
| 949 | + }, |
943 | 950 | {
|
944 | 951 | "id": "Belt.MutableMap.String.checkInvariantInternal",
|
945 | 952 | "kind": "value",
|
|
1302 | 1309 | "docstrings": [],
|
1303 | 1310 | "signature": "let getExn: (t<'a>, key) => 'a"
|
1304 | 1311 | },
|
| 1312 | + { |
| 1313 | + "id": "Belt.MutableMap.Int.getOrThrow", |
| 1314 | + "kind": "value", |
| 1315 | + "name": "getOrThrow", |
| 1316 | + "docstrings": [], |
| 1317 | + "signature": "let getOrThrow: (t<'a>, key) => 'a" |
| 1318 | + }, |
1305 | 1319 | {
|
1306 | 1320 | "id": "Belt.MutableMap.Int.checkInvariantInternal",
|
1307 | 1321 | "kind": "value",
|
|
1713 | 1727 | "docstrings": [],
|
1714 | 1728 | "signature": "let getExn: (t, value) => value"
|
1715 | 1729 | },
|
| 1730 | + { |
| 1731 | + "id": "Belt.MutableSet.String.getOrThrow", |
| 1732 | + "kind": "value", |
| 1733 | + "name": "getOrThrow", |
| 1734 | + "docstrings": [], |
| 1735 | + "signature": "let getOrThrow: (t, value) => value" |
| 1736 | + }, |
1716 | 1737 | {
|
1717 | 1738 | "id": "Belt.MutableSet.String.split",
|
1718 | 1739 | "kind": "value",
|
|
2061 | 2082 | "docstrings": [],
|
2062 | 2083 | "signature": "let getExn: (t, value) => value"
|
2063 | 2084 | },
|
| 2085 | + { |
| 2086 | + "id": "Belt.MutableSet.Int.getOrThrow", |
| 2087 | + "kind": "value", |
| 2088 | + "name": "getOrThrow", |
| 2089 | + "docstrings": [], |
| 2090 | + "signature": "let getOrThrow: (t, value) => value" |
| 2091 | + }, |
2064 | 2092 | {
|
2065 | 2093 | "id": "Belt.MutableSet.Int.split",
|
2066 | 2094 | "kind": "value",
|
|
2368 | 2396 | "docstrings": [],
|
2369 | 2397 | "signature": "let getExn: (t<'k, 'a, 'id>, 'k, ~cmp: cmp<'k, 'id>) => 'a"
|
2370 | 2398 | },
|
| 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 | + }, |
2371 | 2406 | {
|
2372 | 2407 | "id": "Belt.Map.Dict.checkInvariantInternal",
|
2373 | 2408 | "kind": "value",
|
|
2803 | 2838 | "docstrings": [],
|
2804 | 2839 | "signature": "let getExn: (t<'v>, key) => 'v"
|
2805 | 2840 | },
|
| 2841 | + { |
| 2842 | + "id": "Belt.Map.String.getOrThrow", |
| 2843 | + "kind": "value", |
| 2844 | + "name": "getOrThrow", |
| 2845 | + "docstrings": [], |
| 2846 | + "signature": "let getOrThrow: (t<'v>, key) => 'v" |
| 2847 | + }, |
2806 | 2848 | {
|
2807 | 2849 | "id": "Belt.Map.String.checkInvariantInternal",
|
2808 | 2850 | "kind": "value",
|
|
3242 | 3284 | "docstrings": [],
|
3243 | 3285 | "signature": "let getExn: (t<'v>, key) => 'v"
|
3244 | 3286 | },
|
| 3287 | + { |
| 3288 | + "id": "Belt.Map.Int.getOrThrow", |
| 3289 | + "kind": "value", |
| 3290 | + "name": "getOrThrow", |
| 3291 | + "docstrings": [], |
| 3292 | + "signature": "let getOrThrow: (t<'v>, key) => 'v" |
| 3293 | + }, |
3245 | 3294 | {
|
3246 | 3295 | "id": "Belt.Map.Int.checkInvariantInternal",
|
3247 | 3296 | "kind": "value",
|
|
3747 | 3796 | ],
|
3748 | 3797 | "signature": "let getExn: (t<'value, 'id>, 'value, ~cmp: cmp<'value, 'id>) => 'value"
|
3749 | 3798 | },
|
| 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 | + }, |
3750 | 3808 | {
|
3751 | 3809 | "id": "Belt.Set.Dict.split",
|
3752 | 3810 | "kind": "value",
|
|
4082 | 4140 | "docstrings": [],
|
4083 | 4141 | "signature": "let getExn: (t, value) => value"
|
4084 | 4142 | },
|
| 4143 | + { |
| 4144 | + "id": "Belt.Set.String.getOrThrow", |
| 4145 | + "kind": "value", |
| 4146 | + "name": "getOrThrow", |
| 4147 | + "docstrings": [], |
| 4148 | + "signature": "let getOrThrow: (t, value) => value" |
| 4149 | + }, |
4085 | 4150 | {
|
4086 | 4151 | "id": "Belt.Set.String.split",
|
4087 | 4152 | "kind": "value",
|
|
4417 | 4482 | "docstrings": [],
|
4418 | 4483 | "signature": "let getExn: (t, value) => value"
|
4419 | 4484 | },
|
| 4485 | + { |
| 4486 | + "id": "Belt.Set.Int.getOrThrow", |
| 4487 | + "kind": "value", |
| 4488 | + "name": "getOrThrow", |
| 4489 | + "docstrings": [], |
| 4490 | + "signature": "let getOrThrow: (t, value) => value" |
| 4491 | + }, |
4420 | 4492 | {
|
4421 | 4493 | "id": "Belt.Set.Int.split",
|
4422 | 4494 | "kind": "value",
|
|
4921 | 4993 | ],
|
4922 | 4994 | "signature": "let getExn: t<'a, 'b> => 'a"
|
4923 | 4995 | },
|
| 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 | + }, |
4924 | 5005 | {
|
4925 | 5006 | "id": "Belt.Result.mapWithDefaultU",
|
4926 | 5007 | "kind": "value",
|
|
5090 | 5171 | ],
|
5091 | 5172 | "signature": "let getExn: option<'a> => 'a"
|
5092 | 5173 | },
|
| 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 | + }, |
5093 | 5183 | {
|
5094 | 5184 | "id": "Belt.Option.getUnsafe",
|
5095 | 5185 | "kind": "value",
|
|
5889 | 5979 | "docstrings": [],
|
5890 | 5980 | "signature": "let getExn: (t<'k, 'a, 'id>, 'k) => 'a"
|
5891 | 5981 | },
|
| 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 | + }, |
5892 | 5989 | {
|
5893 | 5990 | "id": "Belt.MutableMap.checkInvariantInternal",
|
5894 | 5991 | "kind": "value",
|
|
6357 | 6454 | ],
|
6358 | 6455 | "signature": "let getExn: (t<'value, 'id>, 'value) => 'value"
|
6359 | 6456 | },
|
| 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 | + }, |
6360 | 6466 | {
|
6361 | 6467 | "id": "Belt.MutableSet.split",
|
6362 | 6468 | "kind": "value",
|
|
6707 | 6813 | "kind": "value",
|
6708 | 6814 | "name": "getExn",
|
6709 | 6815 | "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" |
6711 | 6817 | ],
|
6712 | 6818 | "signature": "let getExn: (t<'k, 'v, 'id>, 'k) => 'v"
|
6713 | 6819 | },
|
| 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 | + }, |
6714 | 6829 | {
|
6715 | 6830 | "id": "Belt.Map.remove",
|
6716 | 6831 | "kind": "value",
|
|
7251 | 7366 | ],
|
7252 | 7367 | "signature": "let getExn: (t<'value, 'id>, 'value) => 'value"
|
7253 | 7368 | },
|
| 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 | + }, |
7254 | 7378 | {
|
7255 | 7379 | "id": "Belt.Set.split",
|
7256 | 7380 | "kind": "value",
|
|
7446 | 7570 | ],
|
7447 | 7571 | "signature": "let headExn: t<'a> => 'a"
|
7448 | 7572 | },
|
| 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 | + }, |
7449 | 7582 | {
|
7450 | 7583 | "id": "Belt.List.tail",
|
7451 | 7584 | "kind": "value",
|
|
7464 | 7597 | ],
|
7465 | 7598 | "signature": "let tailExn: t<'a> => t<'a>"
|
7466 | 7599 | },
|
| 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 | + }, |
7467 | 7609 | {
|
7468 | 7610 | "id": "Belt.List.add",
|
7469 | 7611 | "kind": "value",
|
|
7491 | 7633 | ],
|
7492 | 7634 | "signature": "let getExn: (t<'a>, int) => 'a"
|
7493 | 7635 | },
|
| 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 | + }, |
7494 | 7645 | {
|
7495 | 7646 | "id": "Belt.List.make",
|
7496 | 7647 | "kind": "value",
|
|
8447 | 8598 | "kind": "value",
|
8448 | 8599 | "name": "peekExn",
|
8449 | 8600 | "docstrings": [
|
8450 |
| - "raise an exception if `q` is empty" |
| 8601 | + "`peekExn(q)` raises an exception if `q` is empty." |
8451 | 8602 | ],
|
8452 | 8603 | "signature": "let peekExn: t<'a> => 'a"
|
8453 | 8604 | },
|
| 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 | + }, |
8454 | 8614 | {
|
8455 | 8615 | "id": "Belt.MutableQueue.pop",
|
8456 | 8616 | "kind": "value",
|
|
8478 | 8638 | ],
|
8479 | 8639 | "signature": "let popExn: t<'a> => 'a"
|
8480 | 8640 | },
|
| 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 | + }, |
8481 | 8650 | {
|
8482 | 8651 | "id": "Belt.MutableQueue.copy",
|
8483 | 8652 | "kind": "value",
|
|
8712 | 8881 | "name": "Array",
|
8713 | 8882 | "docstrings": [
|
8714 | 8883 | "[`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." |
8716 | 8885 | ],
|
8717 | 8886 | "items": [
|
8718 | 8887 | {
|
|
8758 | 8927 | ],
|
8759 | 8928 | "signature": "let getExn: (t<'a>, int) => 'a"
|
8760 | 8929 | },
|
| 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 | + }, |
8761 | 8939 | {
|
8762 | 8940 | "id": "Belt.Array.getUnsafe",
|
8763 | 8941 | "kind": "value",
|
|
8794 | 8972 | ],
|
8795 | 8973 | "signature": "let setExn: (t<'a>, int, 'a) => unit"
|
8796 | 8974 | },
|
| 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 | + }, |
8797 | 8984 | {
|
8798 | 8985 | "id": "Belt.Array.setUnsafe",
|
8799 | 8986 | "kind": "value",
|
|
0 commit comments