Skip to content

Commit 1ed0754

Browse files
author
github-actions[bot]
committed
Update API docs for v12.0.0-beta.11
1 parent 0121332 commit 1ed0754

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

data/api/v12.0.0/stdlib.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5068,9 +5068,18 @@
50685068
"kind": "value",
50695069
"name": "charCodeAt",
50705070
"docstrings": [
5071-
"`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000. The return type is `float` because this function returns NaN if\n`index` is less than zero or greater than the length of the string.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == 0xd83d->Int.toFloat\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```"
5071+
"`charCodeAt(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAt(`😺`, 0) == Some(0xd83d)\nString.charCodeAt(\"\", 0) == None\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```"
50725072
],
5073-
"signature": "let charCodeAt: (string, int) => float"
5073+
"signature": "let charCodeAt: (string, int) => option<int>"
5074+
},
5075+
{
5076+
"id": "Stdlib.String.charCodeAtUnsafe",
5077+
"kind": "value",
5078+
"name": "charCodeAtUnsafe",
5079+
"docstrings": [
5080+
"`charCodeAtUnsafe(str, index)` returns the character code at position `index` in\nstring `str` the result is in the range 0-65535, unlike `codePointAt`, so it\nwill not work correctly for characters with code points greater than or equal\nto 0x10000.\nBeware: If the index is out of range, it will return `NaN` which is not actually a valid int.\nSee [`String.charCodeAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) on MDN.\n\n## Examples\n\n```rescript\nString.charCodeAtUnsafe(`😺`, 0) == 0xd83d\nString.codePointAt(`😺`, 0) == Some(0x1f63a)\n```"
5081+
],
5082+
"signature": "let charCodeAtUnsafe: (string, int) => int"
50745083
},
50755084
{
50765085
"id": "Stdlib.String.codePointAt",
@@ -8820,7 +8829,7 @@
88208829
"kind": "value",
88218830
"name": "isNaN",
88228831
"docstrings": [
8823-
"`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`NaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```"
8832+
"`isNaN(v)` tests if the given `v` is `NaN`.\nSee [`isNaN`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) on MDN.\n\n## Examples\n\n```rescript\nFloat.isNaN(3.0) // false\nFloat.isNaN(Float.Constants.nan) // true\n```"
88248833
],
88258834
"signature": "let isNaN: float => bool"
88268835
},
@@ -12000,6 +12009,15 @@
1200012009
],
1200112010
"signature": "let filterMap: (array<'a>, 'a => option<'b>) => array<'b>"
1200212011
},
12012+
{
12013+
"id": "Stdlib.Array.filterMapWithIndex",
12014+
"kind": "value",
12015+
"name": "filterMapWithIndex",
12016+
"docstrings": [
12017+
"`filterMapWithIndex(array, fn)`\n\nCalls `fn` for each element and returns a new array containing results of the `fn` calls which are not `None`.\n\n## Examples\n\n```rescript\n[\"Hello\", \"Hi\", \"Good bye\"]->Array.filterMapWithIndex((item, index) =>\n switch item {\n | \"Hello\" => Some(index)\n | _ => None\n }\n) == [0]\n```"
12018+
],
12019+
"signature": "let filterMapWithIndex: (array<'a>, ('a, int) => option<'b>) => array<'b>"
12020+
},
1200312021
{
1200412022
"id": "Stdlib.Array.keepSome",
1200512023
"kind": "value",

0 commit comments

Comments
 (0)