Skip to content

Commit c7255b9

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent 2187664 commit c7255b9

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

packages/analytics-types/index.d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,8 @@ export interface Promotion {
202202
name?: string;
203203
}
204204

205-
206205
declare module '@firebase/component' {
207206
interface NameServiceMapping {
208207
'analytics': FirebaseAnalytics;
209208
}
210-
}
209+
}

packages/app/src/firebaseApp.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,9 @@ export class FirebaseAppImpl implements FirebaseApp {
124124
this.checkDestroyed_();
125125

126126
// getImmediate will always succeed because _getService is only called for registered components.
127-
return (
128-
(this.container
129-
.getProvider(name as Name)
130-
.getImmediate({
131-
identifier: instanceIdentifier
132-
}) as unknown) as FirebaseService
133-
);
127+
return (this.container.getProvider(name as Name).getImmediate({
128+
identifier: instanceIdentifier
129+
}) as unknown) as FirebaseService;
134130
}
135131
/**
136132
* Remove a service instance from the cache, so we will create a new instance for this service

packages/component/src/provider.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ import { Component } from './component';
2828
export class Provider<T extends Name> {
2929
private component: Component<T> | null = null;
3030
private readonly instances: Map<string, NameServiceMapping[T]> = new Map();
31-
private readonly instancesDeferred: Map<string, Deferred<NameServiceMapping[T]>> = new Map();
31+
private readonly instancesDeferred: Map<
32+
string,
33+
Deferred<NameServiceMapping[T]>
34+
> = new Map();
3235

3336
constructor(
3437
private readonly name: T,
@@ -64,8 +67,14 @@ export class Provider<T extends Name> {
6467
* the service is not immediately available.
6568
* If optional is true, the method returns null if the service is not immediately available.
6669
*/
67-
getImmediate(options: { identifier?: string; optional: true }): NameServiceMapping[T] | null;
68-
getImmediate(options?: { identifier?: string; optional?: false }): NameServiceMapping[T];
70+
getImmediate(options: {
71+
identifier?: string;
72+
optional: true;
73+
}): NameServiceMapping[T] | null;
74+
getImmediate(options?: {
75+
identifier?: string;
76+
optional?: false;
77+
}): NameServiceMapping[T];
6978
getImmediate(options?: {
7079
identifier?: string;
7180
optional?: boolean;
@@ -147,7 +156,9 @@ export class Provider<T extends Name> {
147156
return this.component != null;
148157
}
149158

150-
private getOrInitializeService(identifier: string): NameServiceMapping[T] | null {
159+
private getOrInitializeService(
160+
identifier: string
161+
): NameServiceMapping[T] | null {
151162
let instance = this.instances.get(identifier);
152163
if (!instance && this.component) {
153164
instance = this.component.instanceFactory(

packages/component/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface Dictionary {
5656
* This interface will be extended by Firebase SDKs to provide service name and service type mapping.
5757
* It is used as a generic constraint to ensure type safety.
5858
*/
59-
export interface NameServiceMapping { }
59+
export interface NameServiceMapping {}
6060

6161
export type Name = keyof NameServiceMapping;
6262
export type Service = NameServiceMapping[Name];

0 commit comments

Comments
 (0)