Convert IssueUrlRegexUtils to TypeScript

What does this MR do and why?

Converts IssueUrlRegexUtils and its spec to TypeScript. The Manage issue page and the Issues page use it to read issue URLs.

Closes #847 (closed)

What changed

  • All three functions are now function declarations, like most helpers in the app (for example GidUtils.ts). isValidGitLabIssueUrl returns getMatch(...) !== null instead of !!getMatch(...).
  • A judgment call: type stays a string. Nothing reads it, and a 'issues' | 'work_items' type would need a runtime check for something the regex already guarantees. Happy to narrow it if you'd prefer.
  • !3069 (merged) also imports parseGitLabIssueUrl, in platformIssues.ts. It already throws when the result is null, so the two MRs can merge in either order.

Behaviour changes

None.

Part of &33.

/cc @leetickett-gitlab

Edited by Daniel Ahn

Merge request reports

Loading
Loading