Skip to content

Commit ae9776f

Browse files
committed
Rename ErrorList to ErrorMap
1 parent 371d3f1 commit ae9776f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

packages/app/src/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { ErrorFactory, ErrorList } from '@firebase/util';
18+
import { ErrorFactory, ErrorMap } from '@firebase/util';
1919

2020
export const enum AppError {
2121
NO_APP = 'no-app',
@@ -26,7 +26,7 @@ export const enum AppError {
2626
INVALID_APP_ARGUMENT = 'invalid-app-argument'
2727
}
2828

29-
const errors: ErrorList<AppError> = {
29+
const errors: ErrorMap<AppError> = {
3030
[AppError.NO_APP]:
3131
"No Firebase App '{$name}' has been created - " +
3232
'call Firebase App.initializeApp()',

packages/messaging/src/models/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { ErrorFactory, ErrorList } from '@firebase/util';
18+
import { ErrorFactory, ErrorMap } from '@firebase/util';
1919

2020
export const enum ErrorCode {
2121
AVAILABLE_IN_WINDOW = 'only-available-in-window',
@@ -59,7 +59,7 @@ export const enum ErrorCode {
5959
PUBLIC_KEY_DECRYPTION_FAILED = 'public-vapid-key-decryption-failed'
6060
}
6161

62-
export const ERROR_MAP: ErrorList<ErrorCode> = {
62+
export const ERROR_MAP: ErrorMap<ErrorCode> = {
6363
[ErrorCode.AVAILABLE_IN_WINDOW]:
6464
'This method is available in a Window context.',
6565
[ErrorCode.AVAILABLE_IN_SW]:

packages/util/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export {
2828
} from './src/environment';
2929
export {
3030
ErrorFactory,
31-
ErrorList,
31+
ErrorMap,
3232
FirebaseError,
3333
StringLike
3434
} from './src/errors';

packages/util/src/errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* }
5656
*/
5757

58-
export type ErrorList<ErrorCode extends string> = {
58+
export type ErrorMap<ErrorCode extends string> = {
5959
readonly [K in ErrorCode]: string
6060
};
6161

@@ -107,7 +107,7 @@ export class ErrorFactory<ErrorCode extends string> {
107107
constructor(
108108
private readonly service: string,
109109
private readonly serviceName: string,
110-
private readonly errors: ErrorList<ErrorCode>
110+
private readonly errors: ErrorMap<ErrorCode>
111111
) {}
112112

113113
create(code: ErrorCode, data: ErrorData = {}): FirebaseError {

packages/util/test/errors.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
*/
1717
import { assert } from 'chai';
1818
import { stub } from 'sinon';
19-
import { ErrorFactory, ErrorList, FirebaseError } from '../src/errors';
19+
import { ErrorFactory, ErrorMap, FirebaseError } from '../src/errors';
2020

2121
type ErrorCode =
2222
| 'generic-error'
2323
| 'file-not-found'
2424
| 'anon-replace'
2525
| 'overwrite-field';
2626

27-
const ERROR_MAP: ErrorList<ErrorCode> = {
27+
const ERROR_MAP: ErrorMap<ErrorCode> = {
2828
'generic-error': 'Unknown error',
2929
'file-not-found': "Could not find file: '{$file}'",
3030
'anon-replace': 'Hello, {$repl_}!',

0 commit comments

Comments
 (0)