Skip to content

Commit b23e9a2

Browse files
authored
Type the LogBox URL matcher's exec result as RegExpExecArray
Summary: `LogBoxMessage` stores `regex.exec(...)` results in a local annotated as `RegExp$matchResult`, Flow's alias for `RegExpMatchArray` (the result type of `String#match`). Annotate it with `RegExpExecArray`, the type `exec` returns. That stays correct once `RegExpMatchArray`'s `index` and `input` become optional, as in TypeScript's library. Nothing changes at runtime. Changelog: [Internal] Differential Revision: D128877320 Pull Request resolved: #59736
1 parent f1f1474 commit b23e9a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/react-native/Libraries/LogBox/UI/LogBoxMessage.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function getLinkRanges(string: string): ReadonlyArray<Range> {
2525
const regex = /https?:\/\/[^\s$.?#].[^\s]*/gi;
2626
const matches = [];
2727

28-
let regexResult: RegExp$matchResult | null;
28+
let regexResult: RegExpExecArray | null;
2929
while ((regexResult = regex.exec(string)) !== null) {
3030
if (regexResult != null) {
3131
matches.push({

0 commit comments

Comments
 (0)