File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 33module Result = {
44 type t = array <option <string >>
55 @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"
77 @get external index : t => int = "index"
88 @get external input : t => string = "input"
99}
Original file line number Diff line number Diff line change @@ -43,15 +43,15 @@ module Result: {
4343 // This below will log "ReScript" and "is" to the console.
4444 switch regexp->RegExp.exec("ReScript is pretty cool, right?") {
4545 | None => Console.log("Nope, no match...")
46- | Some(result) => switch result->RegExp.Result.matches {
46+ | Some(result) => switch result->RegExp.Result.matches->Array.keepSome {
4747 | [firstWord, secondWord] => Console.log2(firstWord, secondWord)
4848 | _ => Console.log("Didn't find exactly two words...")
4949 }
5050 }
5151 ```
5252 */
5353 @send
54- external matches : (t , @as (1 ) _ ) => array <string > = "slice"
54+ external matches : (t , @as (1 ) _ ) => array <option < string > > = "slice"
5555 @get external index : t => int = "index"
5656
5757 /**
You can’t perform that action at this time.
0 commit comments