File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 16
16
17
17
- Fix node.js ExperimentalWarning. https://github.com/rescript-lang/rescript/pull/7379
18
18
- Fix issue with gentype and stdlib json. https://github.com/rescript-lang/rescript/pull/7378
19
+ - Fix type of ` RegExp.Result.matches ` . https://github.com/rescript-lang/rescript/pull/7393
19
20
20
21
#### :house : Internal
21
22
Original file line number Diff line number Diff line change 3
3
module Result = {
4
4
type t = array <option <string >>
5
5
@get_index external fullMatch : (t , @as (0 ) _ ) => string = ""
6
- @send external matches : (t , @as (1 ) _ ) => array <string > = "slice"
6
+ @send external matches : (t , @as (1 ) _ ) => array <option < string > > = "slice"
7
7
@get external index : t => int = "index"
8
8
@get external input : t => string = "input"
9
9
}
Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ module Result: {
43
43
// This below will log "ReScript" and "is" to the console.
44
44
switch regexp->RegExp.exec("ReScript is pretty cool, right?") {
45
45
| None => Console.log("Nope, no match...")
46
- | Some(result) => switch result->RegExp.Result.matches {
46
+ | Some(result) => switch result->RegExp.Result.matches->Array.keepSome {
47
47
| [firstWord, secondWord] => Console.log2(firstWord, secondWord)
48
48
| _ => Console.log("Didn't find exactly two words...")
49
49
}
50
50
}
51
51
```
52
52
*/
53
53
@send
54
- external matches : (t , @as (1 ) _ ) => array <string > = "slice"
54
+ external matches : (t , @as (1 ) _ ) => array <option < string > > = "slice"
55
55
@get external index : t => int = "index"
56
56
57
57
/**
You can’t perform that action at this time.
0 commit comments