build(docs-infra): add correct types to tuples (#41596)

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
This commit is contained in:
Alan Agius 2021-04-13 15:49:43 +02:00 committed by Zach Arend
parent 15c307b200
commit b3d9dea52b
2 changed files with 3 additions and 3 deletions

View File

@ -60,7 +60,7 @@ export class FirebaseGlob {
const result: { [key: string]: string } = {}; const result: { [key: string]: string } = {};
const names = this.regex.xregexp.captureNames || []; const names = this.regex.xregexp.captureNames || [];
names.forEach(name => result[name] = (match[name])); names.forEach(name => result[name] = match.groups![name]);
return result; return result;
} }
} }

View File

@ -12,8 +12,8 @@ export class FirebaseRedirect {
return undefined; return undefined;
} }
const paramReplacers = Object.keys(this.glob.namedParams).map(name => [ XRegExp(`:${name}`, 'g'), match[name] ]); const paramReplacers = Object.keys(this.glob.namedParams).map<[RegExp, string]>(name => [ XRegExp(`:${name}`, 'g'), match[name] ]);
const restReplacers = Object.keys(this.glob.restParams).map(name => [ XRegExp(`:${name}\\*`, 'g'), match[name] ]); const restReplacers = Object.keys(this.glob.restParams).map<[RegExp, string]>(name => [ XRegExp(`:${name}\\*`, 'g'), match[name] ]);
return XRegExp.replaceEach(this.destination, [...paramReplacers, ...restReplacers]); return XRegExp.replaceEach(this.destination, [...paramReplacers, ...restReplacers]);
} }
} }