Skip to content

Commit 18aecbc

Browse files
authored
Improve AppError typings (#1645)
1 parent d97b62c commit 18aecbc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

packages/app/src/firebaseApp.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ class FirebaseAppImpl implements FirebaseApp {
131131
})
132132
);
133133
})
134-
.then((): void => {
135-
this.isDeleted_ = true;
136-
this.services_ = {};
137-
});
134+
.then(
135+
(): void => {
136+
this.isDeleted_ = true;
137+
this.services_ = {};
138+
}
139+
);
138140
}
139141

140142
/**
@@ -460,9 +462,7 @@ function error(code: AppError, args?: { [name: string]: any }) {
460462
throw appErrors.create(code, args);
461463
}
462464

463-
// TypeScript does not support non-string indexes!
464-
// let errors: {[code: AppError: string} = {
465-
let errors: { [code: string]: string } = {
465+
const errors: { readonly [code in AppError]: string } = {
466466
'no-app':
467467
"No Firebase App '{$name}' has been created - " +
468468
'call Firebase App.initializeApp()',

0 commit comments

Comments
 (0)