diff --git a/aio/tools/firebase-test-utils/FirebaseGlob.ts b/aio/tools/firebase-test-utils/FirebaseGlob.ts index 6db7470cbb..fa857e0409 100644 --- a/aio/tools/firebase-test-utils/FirebaseGlob.ts +++ b/aio/tools/firebase-test-utils/FirebaseGlob.ts @@ -60,7 +60,7 @@ export class FirebaseGlob { const result: { [key: string]: string } = {}; const names = this.regex.xregexp.captureNames || []; - names.forEach(name => result[name] = (match[name])); + names.forEach(name => result[name] = match.groups![name]); return result; } } diff --git a/aio/tools/firebase-test-utils/FirebaseRedirect.ts b/aio/tools/firebase-test-utils/FirebaseRedirect.ts index b8983a7678..d0957e158c 100644 --- a/aio/tools/firebase-test-utils/FirebaseRedirect.ts +++ b/aio/tools/firebase-test-utils/FirebaseRedirect.ts @@ -12,8 +12,8 @@ export class FirebaseRedirect { return undefined; } - const paramReplacers = Object.keys(this.glob.namedParams).map(name => [ XRegExp(`:${name}`, 'g'), match[name] ]); - const restReplacers = Object.keys(this.glob.restParams).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<[RegExp, string]>(name => [ XRegExp(`:${name}\\*`, 'g'), match[name] ]); return XRegExp.replaceEach(this.destination, [...paramReplacers, ...restReplacers]); } }