Skip to content

Commit 3a3df33

Browse files
committed
style(*): run prettier on codebase
1 parent 37cf7e2 commit 3a3df33

File tree

213 files changed

+13279
-8450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+13279
-8450
lines changed

src/app.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@
1414
* limitations under the License.
1515
*/
1616
// Import the createFirebaseNamespace function
17-
import {
18-
createFirebaseNamespace,
19-
FirebaseNamespace
20-
} from './app/firebase_app';
17+
import { createFirebaseNamespace, FirebaseNamespace } from './app/firebase_app';
2118

2219
// Export a single instance of firebase app
2320
const firebase: FirebaseNamespace = createFirebaseNamespace();
2421

25-
export default firebase;
22+
export default firebase;

src/app/errors.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@
5353
* }
5454
* }
5555
*/
56-
export type ErrorList<T> = {[code: string]: string};
56+
export type ErrorList<T> = { [code: string]: string };
5757

5858
const ERROR_NAME = 'FirebaseError';
5959

6060
export interface StringLike {
6161
toString: () => string;
6262
}
6363

64-
let captureStackTrace: (obj: Object, fn?: Function) => void =
65-
(Error as any).captureStackTrace;
64+
let captureStackTrace: (obj: Object, fn?: Function) => void = (Error as any)
65+
.captureStackTrace;
6666

6767
// Export for faking in tests
6868
export function patchCapture(captureFake?: any): any {
@@ -73,24 +73,23 @@ export function patchCapture(captureFake?: any): any {
7373

7474
export interface FirebaseError {
7575
// Unique code for error - format is service/error-code-string
76-
code: string,
76+
code: string;
7777

7878
// Developer-friendly error message.
79-
message: string,
79+
message: string;
8080

8181
// Always 'FirebaseError'
82-
name: string,
82+
name: string;
8383

8484
// Where available - stack backtrace in a string
85-
stack: string,
85+
stack: string;
8686
}
8787

8888
export class FirebaseError implements FirebaseError {
8989
public stack: string;
9090
public name: string;
9191

92-
constructor(public code: string,
93-
public message: string) {
92+
constructor(public code: string, public message: string) {
9493
let stack: string;
9594
// We want the stack value, if implemented by Error
9695
if (captureStackTrace) {
@@ -116,31 +115,32 @@ FirebaseError.prototype.constructor = FirebaseError;
116115

117116
export class ErrorFactory<T extends string> {
118117
// Matches {$name}, by default.
119-
public pattern = /\{\$([^}]+)}/g
118+
public pattern = /\{\$([^}]+)}/g;
120119

121-
constructor(private service: string,
122-
private serviceName: string,
123-
private errors: ErrorList<T>) {
120+
constructor(
121+
private service: string,
122+
private serviceName: string,
123+
private errors: ErrorList<T>
124+
) {
124125
// empty
125126
}
126127

127-
create(code: T, data?: {[prop: string]: StringLike}): FirebaseError {
128+
create(code: T, data?: { [prop: string]: StringLike }): FirebaseError {
128129
if (data === undefined) {
129130
data = {};
130131
}
131132

132-
let template = this.errors[(code as string)];
133+
let template = this.errors[code as string];
133134

134135
let fullCode = this.service + '/' + code;
135136
let message: string;
136137

137138
if (template === undefined) {
138-
message = "Error";
139+
message = 'Error';
139140
} else {
140141
message = template.replace(this.pattern, (match, key) => {
141142
let value = data![key];
142-
return value !== undefined ? value.toString()
143-
: '<' + key + '?>';
143+
return value !== undefined ? value.toString() : '<' + key + '?>';
144144
});
145145
}
146146

@@ -159,4 +159,4 @@ export class ErrorFactory<T extends string> {
159159

160160
return err;
161161
}
162-
}
162+
}

0 commit comments

Comments
 (0)