File tree 3 files changed +6
-3
lines changed 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ external localeCompare : t -> float = "localeCompare" [@@bs.send.pipe: t]
276
276
]}
277
277
278
278
*)
279
- external match_ : Js_re.t -> t array option = " match" [@@bs.send.pipe: t] [@@bs.return {null_to_opt}]
279
+ external match_ : Js_re.t -> t option array option = " match" [@@bs.send.pipe: t] [@@bs.return {null_to_opt}]
280
280
281
281
(* * [normalize str] returns the normalized Unicode string using Normalization Form Canonical (NFC) Composition.
282
282
Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ external localeCompare : t -> t -> float = "localeCompare" [@@bs.send]
273
273
]}
274
274
275
275
*)
276
- external match_ : t -> Js_re.t -> t array option = " match" [@@bs.send] [@@bs.return {null_to_opt}]
276
+ external match_ : t -> Js_re.t -> t option array option = " match" [@@bs.send] [@@bs.return {null_to_opt}]
277
277
278
278
(* * [normalize str] returns the normalized Unicode string using Normalization Form Canonical (NFC) Composition.
279
279
Original file line number Diff line number Diff line change @@ -84,11 +84,14 @@ let suites = Mt.[
84
84
);
85
85
86
86
" match" , (fun _ ->
87
- Eq (Some [| " na" ; " na" |], " banana" |. Js.String2. match_ [% re " /na+/g" ])
87
+ Eq (Some [| Some " na" ; Some " na" |], " banana" |. Js.String2. match_ [% re " /na+/g" ])
88
88
);
89
89
" match - no match" , (fun _ ->
90
90
Eq (None , " banana" |. Js.String2. match_ [% re " /nanana+/g" ])
91
91
);
92
+ " match - not found capture groups" , (fun _ ->
93
+ Eq (Some [| Some " hello " ; None |], " hello word" |. Js.String2. match_ [% re " /hello (world)?/" ] |. Belt.Option. map Js.Array. copy )
94
+ );
92
95
93
96
(* es2015 *)
94
97
" normalize" , (fun _ ->
You can’t perform that action at this time.
0 commit comments