|
254 | 254 | "docstrings": [ |
255 | 255 | "Type representing the result of a `RegExp` execution." |
256 | 256 | ], |
257 | | - "signature": "type t = array<string>" |
| 257 | + "signature": "type t = array<option<string>>" |
258 | 258 | }, |
259 | 259 | { |
260 | 260 | "id": "Core.Re.Result.fullMatch", |
|
1233 | 1233 | "kind": "type", |
1234 | 1234 | "name": "formatMatcher", |
1235 | 1235 | "docstrings": [], |
1236 | | - "signature": "type formatMatcher = [#basic | #bestFit]" |
| 1236 | + "signature": "type formatMatcher = [#basic | #\"best fit\"]" |
1237 | 1237 | }, |
1238 | 1238 | { |
1239 | 1239 | "id": "Core.Intl.DateTimeFormat.fractionalSecondDigits", |
|
1436 | 1436 | "kind": "type", |
1437 | 1437 | "name": "localeMatcher", |
1438 | 1438 | "docstrings": [], |
1439 | | - "signature": "type localeMatcher = [#bestFit | #lookup]" |
| 1439 | + "signature": "type localeMatcher = [#\"best fit\" | #lookup]" |
1440 | 1440 | }, |
1441 | 1441 | { |
1442 | 1442 | "id": "Core.Intl.Common.calendar", |
|
1862 | 1862 | "docstrings": [ |
1863 | 1863 | "Type representing the result of a `RegExp` execution." |
1864 | 1864 | ], |
1865 | | - "signature": "type t = array<string>" |
| 1865 | + "signature": "type t = array<option<string>>" |
1866 | 1866 | }, |
1867 | 1867 | { |
1868 | 1868 | "id": "Core.RegExp.Result.fullMatch", |
|
1993 | 1993 | "kind": "value", |
1994 | 1994 | "name": "floor", |
1995 | 1995 | "docstrings": [ |
1996 | | - "floor(v) returns the largest `int` less than or equal to the argument; \n the result is pinned to the range of the `int` data type: -2147483648 to 2147483647. \n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n Math.Int.floor(-1.0e15) == -2147483648\n Math.Int.floor(1.0e15) == 2147483647\n ```" |
| 1996 | + "floor(v) returns the largest `int` less than or equal to the argument; \n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.floor(3.7) == 3\n Math.Int.floor(3.0) == 3\n Math.Int.floor(-3.1) == -4\n ```" |
1997 | 1997 | ], |
1998 | 1998 | "signature": "let floor: float => int" |
1999 | 1999 | }, |
| 2000 | + { |
| 2001 | + "id": "Core.Math.Int.ceil", |
| 2002 | + "kind": "value", |
| 2003 | + "name": "ceil", |
| 2004 | + "docstrings": [ |
| 2005 | + "ceil(v) returns the smallest `int` greater than or equal to the argument;\n See [`Math.floor`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor)\n on MDN.\n\n ## Examples\n\n ```rescript\n Math.Int.ceil(3.7) == 4\n Math.Int.ceil(3.0) == 3\n Math.Int.ceil(-3.1) == -3\n ```" |
| 2006 | + ], |
| 2007 | + "signature": "let ceil: float => int" |
| 2008 | + }, |
2000 | 2009 | { |
2001 | 2010 | "id": "Core.Math.Int.random", |
2002 | 2011 | "kind": "value", |
|
3176 | 3185 | ], |
3177 | 3186 | "signature": "let lastIndex: t => int" |
3178 | 3187 | }, |
| 3188 | + { |
| 3189 | + "id": "Core.Re.setLastIndex", |
| 3190 | + "kind": "value", |
| 3191 | + "name": "setLastIndex", |
| 3192 | + "docstrings": [ |
| 3193 | + "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" |
| 3194 | + ], |
| 3195 | + "signature": "let setLastIndex: (t, int) => unit" |
| 3196 | + }, |
3179 | 3197 | { |
3180 | 3198 | "id": "Core.Re.ignoreCase", |
3181 | 3199 | "kind": "value", |
|
5401 | 5419 | ], |
5402 | 5420 | "signature": "let get: (string, int) => option<string>" |
5403 | 5421 | }, |
| 5422 | + { |
| 5423 | + "id": "Core.String.getUnsafe", |
| 5424 | + "kind": "value", |
| 5425 | + "name": "getUnsafe", |
| 5426 | + "docstrings": [ |
| 5427 | + "`getUnsafe(str, index)` returns an `string` at the given `index` number.\n\nThis is _unsafe_, meaning it will return `undefined` value if `index` does not exist in `string`.\n\nUse `String.getUnsafe` only when you are sure the `index` exists.\n## Examples\n\n```rescript\nString.getUnsafe(\"ReScript\", 0) == \"R\"\nString.getUnsafe(\"Hello\", 4) == \"o\"\n```" |
| 5428 | + ], |
| 5429 | + "signature": "let getUnsafe: (string, int) => string" |
| 5430 | + }, |
5404 | 5431 | { |
5405 | 5432 | "id": "Core.String.charAt", |
5406 | 5433 | "kind": "value", |
|
5541 | 5568 | "kind": "value", |
5542 | 5569 | "name": "match", |
5543 | 5570 | "docstrings": [ |
5544 | | - "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\nFor regular expressions with the g modifier, a matched expression returns\n`Some(array)` with all the matched substrings and no capture groups.\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([\"bet\"])\nString.match(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([\"bet\", \"bat\"])\nString.match(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([\"2018-04-05\", \"2018\", \"04\", \"05\"])\nString.match(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```" |
| 5571 | + "`match(str, regexp)` matches a `string` against the given `regexp`. If there is\nno match, it returns `None`. For regular expressions without the g modifier, if\nthere is a match, the return value is `Some(array)` where the array contains:\n- The entire matched string\n- Any capture groups if the regexp had parentheses\nFor regular expressions with the g modifier, a matched expression returns\n`Some(array)` with all the matched substrings and no capture groups.\nSee [`String.match`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match) on MDN.\n\n## Examples\n\n```rescript\nString.match(\"The better bats\", %re(\"/b[aeiou]t/\")) == Some([Some(\"bet\")])\nString.match(\"The better bats\", %re(\"/b[aeiou]t/g\")) == Some([Some(\"bet\"), Some(\"bat\")])\nString.match(\"Today is 2018-04-05.\", %re(\"/(\\d+)-(\\d+)-(\\d+)/\")) ==\n Some([Some(\"2018-04-05\"), Some(\"2018\"), Some(\"04\"), Some(\"05\")])\nString.match(\"The optional example\", %re(\"/(foo)?(example)/\")) == Some([Some(\"example\"), None, Some(\"example\")])\nString.match(\"The large container.\", %re(\"/b[aeiou]g/\")) == None\n```" |
5545 | 5572 | ], |
5546 | 5573 | "signature": "let match: (string, Core__RegExp.t) => option<Core__RegExp.Result.t>" |
5547 | 5574 | }, |
|
5933 | 5960 | ], |
5934 | 5961 | "signature": "let lastIndex: t => int" |
5935 | 5962 | }, |
| 5963 | + { |
| 5964 | + "id": "Core.RegExp.setLastIndex", |
| 5965 | + "kind": "value", |
| 5966 | + "name": "setLastIndex", |
| 5967 | + "docstrings": [ |
| 5968 | + "`setLastIndex(regexp, index)` set the index the next match will start from.\n\nSee [`RegExp.lastIndex`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex) on MDN.\n\n## Examples\n```rescript\n// Match the first word in a sentence\nlet regexp = RegExp.fromString(\"\\\\w+\")\nlet someStr = \"Many words here.\"\n\nregexp->RegExp.setLastIndex(4)\nregexp->RegExp.exec(someStr)->ignore\n\nConsole.log(regexp->RegExp.lastIndex) // Logs `10` to the console\n```" |
| 5969 | + ], |
| 5970 | + "signature": "let setLastIndex: (t, int) => unit" |
| 5971 | + }, |
5936 | 5972 | { |
5937 | 5973 | "id": "Core.RegExp.ignoreCase", |
5938 | 5974 | "kind": "value", |
|
6523 | 6559 | ], |
6524 | 6560 | "signature": "let undefined: t<'a>" |
6525 | 6561 | }, |
| 6562 | + { |
| 6563 | + "id": "Core.Nullable.isNullable", |
| 6564 | + "kind": "value", |
| 6565 | + "name": "isNullable", |
| 6566 | + "docstrings": [ |
| 6567 | + "`isNullable(a)` returns `true` if `a` is null or undefined, `false` otherwise.\n\n## Examples\n\n```rescript\nlet myStr = \"Hello\"\nlet asNullable = myStr->Nullable.make\n\n// Can't do the below because we're now forced to check for nullability\n// myStr == asNullable\n\n// Check if asNullable is not null or undefined\nswitch asNullable->Nullable.isNullable {\n| true => assert(false)\n| false => assert(true)\n}\n```" |
| 6568 | + ], |
| 6569 | + "signature": "let isNullable: t<'a> => bool" |
| 6570 | + }, |
6526 | 6571 | { |
6527 | 6572 | "id": "Core.Nullable.make", |
6528 | 6573 | "kind": "value", |
|
9782 | 9827 | "kind": "value", |
9783 | 9828 | "name": "every", |
9784 | 9829 | "docstrings": [ |
9785 | | - "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.every(num => num > 4)) // true\nConsole.log(array->Array.every(num => num === 1)) // false\n```" |
| 9830 | + "`every(array, predicate)` returns true if `predicate` returns true for all items in `array`.\n\nSee [`Array.every`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) on MDN.\n\n## Examples\n```rescript\nlet array = [1, 2, 3, 4]\n\nConsole.log(array->Array.every(num => num <= 4)) // true\nConsole.log(array->Array.every(num => num === 1)) // false\n```" |
9786 | 9831 | ], |
9787 | 9832 | "signature": "let every: (array<'a>, 'a => bool) => bool" |
9788 | 9833 | }, |
|
0 commit comments