This commit updates the utilities in `firebase-test-utils/` to also
support testing Firebase redirects that are configured using regular
expressions (via the `regex` property).
See the [Firebase docs][1] for more details.
[1]: https://firebase.google.com/docs/hosting/full-config#redirects
PR Close#41842
Currently, the utilities for testing Firebase redirects assume that the
redirects are configured using the glob-based `source` property.
However, Firebase also supports configuring redirects using regular
expressions (via the `regex` property).
See the [Firebase docs][1] for more details.
This commit refactors the utilities in `firebase-test-utils/` to make it
easy to add support for such regex-based redirect configurations.
[1]: https://firebase.google.com/docs/hosting/full-config#redirects
PR Close#41842
This is to fix the below error:
```
tools/firebase-test-utils/FirebaseRedirect.ts:17:50 - error TS2345: Argument of type '(string | RegExp)[][]' is not assignable to parameter of type 'ReplacementDetail[]'.
Type '(string | RegExp)[]' is missing the following properties from type 'ReplacementDetail': 0, 1
17 return XRegExp.replaceEach(this.destination, [...paramReplacers, ...restReplacers]);
```
https://app.circleci.com/pipelines/github/angular/angular/31076/workflows/5fd3851e-ae9e-4d77-b0ef-366ba38a9088/jobs/961795
PR Close#41596