Skip to content

Commit 2204d79

Browse files
committed
[AUTOMATED]: Prettier Code Styling
1 parent fa69278 commit 2204d79

15 files changed

+63
-66
lines changed

packages/firestore/src/api/user_data_converter.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ import * as firestore from '@firebase/firestore-types';
2020
import { Timestamp } from '../api/timestamp';
2121
import { DatabaseId } from '../core/database_info';
2222
import { DocumentKey } from '../model/document_key';
23-
import { FieldValue, NumberValue, ObjectValue ,
23+
import {
24+
FieldValue,
25+
NumberValue,
26+
ObjectValue,
2427
ArrayValue,
2528
BlobValue,
2629
BooleanValue,

packages/firestore/src/core/event_manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import { ObjectMap } from '../util/obj_map';
2121
import { Query } from './query';
2222
import { SyncEngine, SyncEngineListener } from './sync_engine';
2323
import { OnlineState, TargetId } from './types';
24-
import { DocumentViewChange , ChangeType, ViewSnapshot } from './view_snapshot';
25-
24+
import { DocumentViewChange, ChangeType, ViewSnapshot } from './view_snapshot';
2625

2726
/**
2827
* Holds the listeners and the last received ViewSnapshot for a query being

packages/firestore/src/core/transaction.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import { ParsedSetData, ParsedUpdateData } from '../api/user_data_converter';
1919
import { documentVersionMap } from '../model/collections';
20-
import { Document, NoDocument , MaybeDocument } from '../model/document';
20+
import { Document, NoDocument, MaybeDocument } from '../model/document';
2121

2222
import { DocumentKey } from '../model/document_key';
2323
import { DeleteMutation, Mutation, Precondition } from '../model/mutation';

packages/firestore/src/local/indexeddb_schema.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,9 @@ export class SchemaConverter implements SimpleDbSchemaConverter {
249249

250250
// Helper to add an index entry iff we haven't already written it.
251251
const cache = new MemoryCollectionParentIndex();
252-
const addEntry = (collectionPath: ResourcePath): PersistencePromise<void> | undefined => {
252+
const addEntry = (
253+
collectionPath: ResourcePath
254+
): PersistencePromise<void> | undefined => {
253255
if (cache.add(collectionPath)) {
254256
const collectionId = collectionPath.lastSegment();
255257
const parentPath = collectionPath.popLast();

packages/firestore/src/platform/config/goog_module_config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import { configureForStandalone } from '../config';
1919

20-
2120
/**
2221
* Magic variable that is used to export the Firestore namespace.
2322
*

packages/firestore/src/remote/datastore.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import { assert } from '../util/assert';
2525
import { AsyncQueue } from '../util/async_queue';
2626
import { Code, FirestoreError } from '../util/error';
2727
import { Connection } from './connection';
28-
import { WatchStreamListener, WriteStreamListener ,
28+
import {
29+
WatchStreamListener,
30+
WriteStreamListener,
2931
PersistentListenStream,
3032
PersistentWriteStream
3133
} from './persistent_stream';

packages/firestore/src/util/misc.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
import { assert } from './assert';
1919

2020
export type EventHandler<E> = (value: E) => void;
21-
export interface Indexable { [k: string]: unknown }
21+
export interface Indexable {
22+
[k: string]: unknown;
23+
}
2224

2325
export class AutoId {
2426
static newId(): string {

packages/firestore/test/unit/local/persistence_test_helpers.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ import {
2222
BatchId,
2323
MutationBatchState,
2424
OnlineState,
25-
TargetId
26-
, ListenSequenceNumber } from '../../../src/core/types';
25+
TargetId,
26+
ListenSequenceNumber
27+
} from '../../../src/core/types';
2728

2829
import { IndexedDbPersistence } from '../../../src/local/indexeddb_persistence';
2930
import { LocalSerializer } from '../../../src/local/local_serializer';

packages/firestore/test/unit/local/web_storage_shared_client_state.test.ts

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,16 @@ const TEST_ERROR = new FirestoreError('internal', 'Test Error');
5555

5656
function mutationKey(user: User, batchId: BatchId): string {
5757
if (user.isAuthenticated()) {
58-
return `firestore_mutations_${
59-
TEST_PERSISTENCE_PREFIX
60-
}_${batchId}_${user.uid}`;
58+
return `firestore_mutations_${TEST_PERSISTENCE_PREFIX}_${batchId}_${
59+
user.uid
60+
}`;
6161
} else {
62-
return `firestore_mutations_${
63-
TEST_PERSISTENCE_PREFIX
64-
}_${batchId}`;
62+
return `firestore_mutations_${TEST_PERSISTENCE_PREFIX}_${batchId}`;
6563
}
6664
}
6765

6866
function targetKey(targetId: TargetId): string {
69-
return `firestore_targets_${
70-
TEST_PERSISTENCE_PREFIX
71-
}_${targetId}`;
67+
return `firestore_targets_${TEST_PERSISTENCE_PREFIX}_${targetId}`;
7268
}
7369

7470
function onlineStateKey(): string {
@@ -237,9 +233,7 @@ describe('WebStorageSharedClientState', () => {
237233
function assertClientState(activeTargetIds: TargetId[]): void {
238234
const actual = JSON.parse(
239235
webStorage.getItem(
240-
`firestore_clients_${
241-
TEST_PERSISTENCE_PREFIX
242-
}_${primaryClientId}`
236+
`firestore_clients_${TEST_PERSISTENCE_PREFIX}_${primaryClientId}`
243237
)!
244238
);
245239

@@ -390,23 +384,20 @@ describe('WebStorageSharedClientState', () => {
390384

391385
describe('combines client state', () => {
392386
const secondaryClientId = AutoId.newId();
393-
const secondaryClientStateKey = `firestore_clients_${
394-
TEST_PERSISTENCE_PREFIX
395-
}_${secondaryClientId}`;
387+
const secondaryClientStateKey = `firestore_clients_${TEST_PERSISTENCE_PREFIX}_${secondaryClientId}`;
396388

397389
beforeEach(() => {
398390
const existingClientId = AutoId.newId();
399391

400392
return populateWebStorage(
401-
AUTHENTICATED_USER,
402-
existingClientId,
403-
[1, 2],
404-
[3, 4]
405-
)
406-
.then(() => {
407-
clientSyncer.activeClients = [primaryClientId, existingClientId];
408-
return sharedClientState.start();
409-
});
393+
AUTHENTICATED_USER,
394+
existingClientId,
395+
[1, 2],
396+
[3, 4]
397+
).then(() => {
398+
clientSyncer.activeClients = [primaryClientId, existingClientId];
399+
return sharedClientState.start();
400+
});
410401
});
411402

412403
async function verifyState(
@@ -526,9 +517,7 @@ describe('WebStorageSharedClientState', () => {
526517
});
527518

528519
it('ignores invalid data', async () => {
529-
const secondaryClientStateKey = `firestore_clients_${
530-
TEST_PERSISTENCE_PREFIX
531-
}_${AutoId.newId()}`;
520+
const secondaryClientStateKey = `firestore_clients_${TEST_PERSISTENCE_PREFIX}_${AutoId.newId()}`;
532521

533522
const invalidState = {
534523
activeTargetIds: [5, 'invalid']
@@ -669,12 +658,8 @@ describe('WebStorageSharedClientState', () => {
669658
const firstClientTargetId: TargetId = 1;
670659
const secondClientTargetId: TargetId = 2;
671660

672-
const firstClientStorageKey = `firestore_clients_${
673-
TEST_PERSISTENCE_PREFIX
674-
}_${AutoId.newId()}`;
675-
const secondClientStorageKey = `firestore_clients_${
676-
TEST_PERSISTENCE_PREFIX
677-
}_${AutoId.newId()}`;
661+
const firstClientStorageKey = `firestore_clients_${TEST_PERSISTENCE_PREFIX}_${AutoId.newId()}`;
662+
const secondClientStorageKey = `firestore_clients_${TEST_PERSISTENCE_PREFIX}_${AutoId.newId()}`;
678663

679664
let firstClient: LocalClientState;
680665
let secondClientState: LocalClientState;

packages/firestore/test/unit/model/document.test.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,8 @@ describe('Document', () => {
5454
it('equals to other same documents', () => {
5555
expect(doc('a/b', 0, {}).isEqual(null)).to.equal(false);
5656

57-
expectEqual(
58-
doc('a/b', 3, { foo: 'bar' }),
59-
doc('a/b', 3, { foo: 'bar' })
60-
);
61-
expectEqual(
62-
doc('a/b', 1, { foo: NaN }),
63-
doc('a/b', 1, { foo: NaN })
64-
);
57+
expectEqual(doc('a/b', 3, { foo: 'bar' }), doc('a/b', 3, { foo: 'bar' }));
58+
expectEqual(doc('a/b', 1, { foo: NaN }), doc('a/b', 1, { foo: NaN }));
6559

6660
expectNotEqual(
6761
doc('a/b', 1, { foo: 'bar' }),
@@ -71,10 +65,7 @@ describe('Document', () => {
7165
doc('a/b', 1, { foo: 'bar' }),
7266
doc('a/b', 2, { foo: 'bar' })
7367
);
74-
expectNotEqual(
75-
doc('a/b', 1, { foo: 'bar' }),
76-
doc('a/b', 1, { foo: 100 })
77-
);
68+
expectNotEqual(doc('a/b', 1, { foo: 'bar' }), doc('a/b', 1, { foo: 100 }));
7869
expectNotEqual(
7970
doc('a/b', 1, { foo: 'bar' }, { hasLocalMutations: true }),
8071
doc('a/b', 1, { foo: 'bar' }, { hasLocalMutations: false })

packages/firestore/test/unit/remote/remote_event.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ import {
4747
/* eslint-disable @typescript-eslint/prefer-interface */
4848
interface TargetMap {
4949
[targetId: number]: QueryData;
50-
};
50+
}
5151
interface PendingTargetResponses {
5252
[targetId: string]: number;
53-
};
53+
}
5454
/* eslint-enable @typescript-eslint/prefer-interface */
5555

5656
function listens(...targetIds: TargetId[]): TargetMap {

packages/firestore/test/unit/specs/listen_spec.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,9 @@ describeSpec('Listens:', [], () => {
448448
});
449449

450450
specTest('Listens are reestablished after network disconnect', [], () => {
451-
const expectRequestCount = (requestCounts: { [type: string]: number }): number =>
452-
requestCounts.addTarget + requestCounts.removeTarget;
451+
const expectRequestCount = (requestCounts: {
452+
[type: string]: number;
453+
}): number => requestCounts.addTarget + requestCounts.removeTarget;
453454

454455
const query = Query.atPath(path('collection'));
455456
const docA = doc('collection/a', 1000, { key: 'a' });

packages/firestore/test/unit/specs/spec_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
mapCodeFromRpcCode,
3131
mapRpcCodeFromCode
3232
} from '../../../src/remote/rpc_error';
33-
import { assert , fail } from '../../../src/util/assert';
33+
import { assert, fail } from '../../../src/util/assert';
3434

3535
import { Code } from '../../../src/util/error';
3636
import * as objUtils from '../../../src/util/obj';

packages/firestore/test/unit/specs/write_spec.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,9 @@ describeSpec('Writes:', [], () => {
772772
);
773773

774774
specTest('Writes are resent after network disconnect', [], () => {
775-
const expectRequestCount = (requestCounts: { [type: string]: number }): number =>
775+
const expectRequestCount = (requestCounts: {
776+
[type: string]: number;
777+
}): number =>
776778
requestCounts.handshakes + requestCounts.writes + requestCounts.closes;
777779

778780
return spec()

packages/firestore/test/util/equality_matcher.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,27 @@ function customDeepEqual(left: unknown, right: unknown): boolean {
4949
) {
5050
return true;
5151
}
52-
if (typeof left !== typeof right) {return false;} // needed for structurally different objects
53-
if (Object(left) !== left) {return false;} // primitive values
52+
if (typeof left !== typeof right) {
53+
return false;
54+
} // needed for structurally different objects
55+
if (Object(left) !== left) {
56+
return false;
57+
} // primitive values
5458
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5559
const keys = Object.keys(left as any);
5660
// eslint-disable-next-line @typescript-eslint/no-explicit-any
57-
if (keys.length !== Object.keys(right as any).length) {return false;}
61+
if (keys.length !== Object.keys(right as any).length) {
62+
return false;
63+
}
5864
for (let i = 0; i < keys.length; i++) {
5965
const key = keys[i];
60-
if (!Object.prototype.hasOwnProperty.call(right, key)) {return false;}
66+
if (!Object.prototype.hasOwnProperty.call(right, key)) {
67+
return false;
68+
}
6169
// eslint-disable-next-line @typescript-eslint/no-explicit-any
62-
if (!customDeepEqual((left as any)[key], (right as any)[key])) {return false;}
70+
if (!customDeepEqual((left as any)[key], (right as any)[key])) {
71+
return false;
72+
}
6373
}
6474
return true;
6575
}

0 commit comments

Comments
 (0)