Skip to content

Commit 26ce7e1

Browse files
Run yarn format
1 parent ed9a8b1 commit 26ce7e1

File tree

8 files changed

+33
-25
lines changed

8 files changed

+33
-25
lines changed

packages/firebase/compat/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,15 +2054,15 @@ declare namespace firebase.remoteConfig {
20542054

20552055
/**
20562056
* Defines the type for representing custom signals and their values.
2057-
*
2057+
*
20582058
* <p>The values in CustomSignals must be one of the following types:
20592059
*
20602060
* <ul>
20612061
* <li><code>string</code>
20622062
* <li><code>number</code>
20632063
* </ul>
20642064
*/
2065-
export type CustomSignals = {[key: string]: string | number};
2065+
export type CustomSignals = { [key: string]: string | number };
20662066

20672067
/**
20682068
* This method provides two different checks:

packages/remote-config-compat/src/remoteConfig.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,15 @@ describe('Remote Config Compat', () => {
159159
});
160160

161161
it('setCustomSignals() calls modular setCustomSignals()', async () => {
162-
const modularSetCustomSignalsStub = stub(modularApi, 'setCustomSignals').callsFake(() =>
163-
Promise.resolve()
164-
);
165-
await remoteConfig.setCustomSignals({'customSignal': 'value'});
162+
const modularSetCustomSignalsStub = stub(
163+
modularApi,
164+
'setCustomSignals'
165+
).callsFake(() => Promise.resolve());
166+
await remoteConfig.setCustomSignals({ 'customSignal': 'value' });
166167

167168
expect(modularSetCustomSignalsStub).to.have.been.calledWithExactly(
168169
fakeModularRemoteConfig,
169-
{'customSignal': 'value'}
170+
{ 'customSignal': 'value' }
170171
);
171172
});
172173
});

packages/remote-config-types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ export type LogLevel = 'debug' | 'error' | 'silent';
180180

181181
/**
182182
* Defines the type for representing custom signals and their values.
183-
*
183+
*
184184
* <p>The values in CustomSignals must be one of the following types:
185185
*
186186
* <ul>
187187
* <li><code>string</code>
188188
* <li><code>number</code>
189189
* </ul>
190190
*/
191-
export type CustomSignals = {[key: string]: string | number};
191+
export type CustomSignals = { [key: string]: string | number };
192192

193193
declare module '@firebase/component' {
194194
interface NameServiceMapping {

packages/remote-config/src/api.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,16 @@ function getAllKeys(obj1: {} = {}, obj2: {} = {}): string[] {
263263

264264
/**
265265
* Sets the custom signals for the app instance.
266-
*
266+
*
267267
* @param remoteConfig - The {@link RemoteConfig} instance.
268268
* @param customSignals - Map (key, value) of the custom signals to be set for the app instance.
269-
*
269+
*
270270
* @public
271271
*/
272272
export async function setCustomSignals(
273-
remoteConfig: RemoteConfig, customSignals: CustomSignals): Promise<void> {
273+
remoteConfig: RemoteConfig,
274+
customSignals: CustomSignals
275+
): Promise<void> {
274276
const rc = getModularInstance(remoteConfig) as RemoteConfigImpl;
275277
return rc._storageCache.setCustomSignals(customSignals);
276-
}
278+
}

packages/remote-config/src/client/remote_config_fetch_client.ts

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

18-
import { CustomSignals } from "../public_types";
18+
import { CustomSignals } from '../public_types';
1919

2020
/**
2121
* Defines a client, as in https://en.wikipedia.org/wiki/Client%E2%80%93server_model, for the
@@ -102,9 +102,8 @@ export interface FetchRequest {
102102
*/
103103
eTag?: string;
104104

105-
106105
/** The custom signals stored for the app instance.
107-
*
106+
*
108107
* <p>Optional in case no custom signals are set for the instance.
109108
*/
110109
customSignals?: CustomSignals;

packages/remote-config/src/public_types.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,19 @@ export type LogLevel = 'debug' | 'error' | 'silent';
136136

137137
/**
138138
* Defines the type for representing custom signals and their values.
139-
*
139+
*
140140
* <p>The values in CustomSignals must be one of the following types:
141141
*
142142
* <ul>
143143
* <li><code>string</code>
144144
* <li><code>number</code>
145145
* </ul>
146-
*
146+
*
147147
* @public
148148
*/
149-
export interface CustomSignals {[key: string]: string | number};
149+
export interface CustomSignals {
150+
[key: string]: string | number;
151+
}
150152

151153
declare module '@firebase/component' {
152154
interface NameServiceMapping {

packages/remote-config/src/storage/storage.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,22 +191,28 @@ export class Storage {
191191
return new Promise((resolve, reject) => {
192192
const transaction = db.transaction([APP_NAMESPACE_STORE], 'readwrite');
193193
const objectStore = transaction.objectStore(APP_NAMESPACE_STORE);
194-
const compositeKey = this.createCompositeKey("custom_signals");
194+
const compositeKey = this.createCompositeKey('custom_signals');
195195
try {
196196
const storedSignalsRequest = objectStore.get(compositeKey);
197197
storedSignalsRequest.onerror = event => {
198198
reject(toFirebaseError(event, ErrorCode.STORAGE_GET));
199199
};
200200
storedSignalsRequest.onsuccess = event => {
201-
const storedSignals = (event.target as IDBRequest).result?.value || {};
201+
const storedSignals =
202+
(event.target as IDBRequest).result?.value || {};
202203
const combinedSignals = {
203204
...storedSignals,
204205
...customSignals
205206
};
206207
// Filter out key-value assignments with null values since they are signals being unset
207-
const signalsToUpdate = Object.fromEntries(Object.entries(combinedSignals).filter(([_, v]) => v !== null));
208+
const signalsToUpdate = Object.fromEntries(
209+
Object.entries(combinedSignals).filter(([_, v]) => v !== null)
210+
);
208211
if (signalsToUpdate) {
209-
const setSignalsRequest = objectStore.put({compositeKey, value: signalsToUpdate});
212+
const setSignalsRequest = objectStore.put({
213+
compositeKey,
214+
value: signalsToUpdate
215+
});
210216
setSignalsRequest.onerror = event => {
211217
reject(toFirebaseError(event, ErrorCode.STORAGE_SET));
212218
};

packages/remote-config/src/storage/storage_cache.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export class StorageCache {
3333
private activeConfig?: FirebaseRemoteConfigObject;
3434
private customSignals?: CustomSignals;
3535

36-
3736
/**
3837
* Memory-only getters
3938
*/
@@ -53,7 +52,6 @@ export class StorageCache {
5352
return this.customSignals;
5453
}
5554

56-
5755
/**
5856
* Read-ahead getter
5957
*/

0 commit comments

Comments
 (0)