Skip to content

Run prettier 1.9.1 #2369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/database/src/core/util/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const enableLogging = function(
persistent?: boolean
) {
assert(
!persistent || (logger_ === true || logger_ === false),
!persistent || logger_ === true || logger_ === false,
"Can't turn on custom loggers persistently."
);
if (logger_ === true) {
Expand Down
6 changes: 3 additions & 3 deletions packages/database/src/core/view/EventRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,9 @@ export class ChildEventRegistration implements EventRegistration {
* @param {Object=} context_
*/
constructor(
private callbacks_:
| ({ [k: string]: (d: DataSnapshot, s?: string | null) => void })
| null,
private callbacks_: {
[k: string]: (d: DataSnapshot, s?: string | null) => void;
} | null,
private cancelCallback_: ((e: Error) => void) | null,
private context_?: Object
) {}
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6890,7 +6890,7 @@ declare namespace firebase.storage {
| null
| ((a: UploadTaskSnapshot) => any),
error?: ((a: Error) => any) | null,
complete?: (firebase.Unsubscribe) | null
complete?: firebase.Unsubscribe | null
): Function;
/**
* Pauses a running task. Has no effect on a paused or failed task.
Expand Down
7 changes: 4 additions & 3 deletions packages/firestore/src/api/user_data_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,10 @@ export class UserDataConverter {

for (let i = 0; i < moreFieldsAndValues.length; i += 2) {
keys.push(
fieldPathFromArgument(methodName, moreFieldsAndValues[i] as
| string
| ExternalFieldPath)
fieldPathFromArgument(
methodName,
moreFieldsAndValues[i] as string | ExternalFieldPath
)
);
values.push(moreFieldsAndValues[i + 1]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,10 @@ export class IndexedDbRemoteDocumentCache implements RemoteDocumentCache {
*/
private static RemoteDocumentChangeBuffer = class extends RemoteDocumentChangeBuffer {
// A map of document sizes prior to applying the changes in this buffer.
protected documentSizes: ObjectMap<DocumentKey, number> = new ObjectMap(
key => key.toString()
);
protected documentSizes: ObjectMap<
DocumentKey,
number
> = new ObjectMap(key => key.toString());

/**
* @param documentCache The IndexedDbRemoteDocumentCache to apply the changes to.
Expand Down
8 changes: 5 additions & 3 deletions packages/firestore/src/local/indexeddb_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,11 @@ export class SchemaConverter implements SimpleDbSchemaConverter {
);
const batch = this.serializer.fromDbMutationBatch(dbBatch);

return removeMutationBatch(txn, queue.userId, batch).next(
() => {}
);
return removeMutationBatch(
txn,
queue.userId,
batch
).next(() => {});
}
);
});
Expand Down
10 changes: 4 additions & 6 deletions packages/firestore/test/integration/api/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ apiDescribe('Database', (persistence: boolean) => {
await writerRef
.get({ source: 'cache' })
.then(doc => expect(doc.exists).to.be.true);
await readerRef
.get({ source: 'cache' })
.then(
() => fail('Expected cache miss'),
err => expect(err.code).to.be.equal(Code.UNAVAILABLE)
);
await readerRef.get({ source: 'cache' }).then(
() => fail('Expected cache miss'),
err => expect(err.code).to.be.equal(Code.UNAVAILABLE)
);
await writerRef
.get()
.then(doc => expect(doc.data()).to.deep.equal({ a: 'a', b: 'b' }));
Expand Down
5 changes: 4 additions & 1 deletion packages/firestore/test/unit/core/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ import {

describe('Bound', () => {
function makeBound(values: unknown[], before: boolean): Bound {
return new Bound(values.map(el => wrap(el)), before);
return new Bound(
values.map(el => wrap(el)),
before
);
}

it('implements isEqual', () => {
Expand Down
5 changes: 4 additions & 1 deletion packages/firestore/test/unit/local/simple_db.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ describe('SimpleDb', () => {
return store.put(dummyUser).next(() => {
throw new Error('Generated error');
});
}).then(() => {}, error => Promise.reject(error))
}).then(
() => {},
error => Promise.reject(error)
)
).to.eventually.be.rejectedWith('Generated error');

await runTransaction(store => {
Expand Down
2 changes: 1 addition & 1 deletion packages/firestore/test/util/test_platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class FakeWindow {
});
this.fakeIndexedDb =
fakeIndexedDb ||
((typeof window !== 'undefined' && window.indexedDB) || null);
(typeof window !== 'undefined' && window.indexedDB) || null;
}

get localStorage(): Storage {
Expand Down
35 changes: 20 additions & 15 deletions packages/messaging/test/controller-delete-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ describe('Firebase Messaging > *Controller.deleteToken()', () => {
return EXAMPLE_TOKEN_SAVE;
});

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

messagingService = new WindowController(app);
return messagingService.deleteToken(EXAMPLE_TOKEN_SAVE.fcmToken);
Expand All @@ -133,9 +134,10 @@ describe('Firebase Messaging > *Controller.deleteToken()', () => {
return EXAMPLE_TOKEN_SAVE;
});

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

messagingService = new WindowController(app);
return messagingService.deleteToken(EXAMPLE_TOKEN_SAVE.fcmToken).then(
Expand All @@ -162,9 +164,10 @@ describe('Firebase Messaging > *Controller.deleteToken()', () => {
}
);

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

messagingService = new serviceClass(app);
return messagingService.deleteToken(EXAMPLE_TOKEN_SAVE.fcmToken);
Expand All @@ -191,9 +194,10 @@ describe('Firebase Messaging > *Controller.deleteToken()', () => {
}
);

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

messagingService = new serviceClass(app);
return messagingService.deleteToken(EXAMPLE_TOKEN_SAVE.fcmToken).then(
Expand Down Expand Up @@ -258,9 +262,10 @@ describe('Firebase Messaging > *Controller.deleteToken()', () => {
}
);

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

messagingService = new serviceClass(app);
return messagingService.deleteToken(EXAMPLE_TOKEN_SAVE.fcmToken);
Expand Down
77 changes: 44 additions & 33 deletions packages/messaging/test/controller-get-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
() => 'granted'
);

stub(TokenDetailsModel.prototype, 'getTokenDetailsFromSWScope').callsFake(
() => Promise.resolve(EXAMPLE_TOKEN_DETAILS_CUSTOM_VAPID)
);
stub(
TokenDetailsModel.prototype,
'getTokenDetailsFromSWScope'
).callsFake(() => Promise.resolve(EXAMPLE_TOKEN_DETAILS_CUSTOM_VAPID));

const serviceInstance = new serviceClass(app);
const token = await serviceInstance.getToken();
Expand All @@ -255,9 +256,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
() => 'granted'
);

stub(TokenDetailsModel.prototype, 'getTokenDetailsFromSWScope').callsFake(
() => Promise.resolve(EXAMPLE_EXPIRED_TOKEN_DETAILS)
);
stub(
TokenDetailsModel.prototype,
'getTokenDetailsFromSWScope'
).callsFake(() => Promise.resolve(EXAMPLE_EXPIRED_TOKEN_DETAILS));

stub(serviceClass.prototype, 'getPublicVapidKey_').callsFake(() =>
Promise.resolve(DEFAULT_PUBLIC_VAPID_KEY)
Expand All @@ -271,13 +273,15 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
Promise.resolve(EXAMPLE_FCM_TOKEN)
);

stub(TokenDetailsModel.prototype, 'saveTokenDetails').callsFake(
async () => {}
);
stub(
TokenDetailsModel.prototype,
'saveTokenDetails'
).callsFake(async () => {});

stub(VapidDetailsModel.prototype, 'saveVapidDetails').callsFake(
async () => {}
);
stub(
VapidDetailsModel.prototype,
'saveVapidDetails'
).callsFake(async () => {});

const serviceInstance = new serviceClass(app);
const token = await serviceInstance.getToken();
Expand Down Expand Up @@ -396,9 +400,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
stub(SubscriptionManager.prototype, 'getToken').callsFake(() =>
Promise.resolve(GET_TOKEN_RESPONSE)
);
stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

const registration = generateFakeReg();
mockGetReg(Promise.resolve(registration));
Expand Down Expand Up @@ -460,13 +465,15 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
Promise.resolve(DEFAULT_PUBLIC_VAPID_KEY)
);

stub(VapidDetailsModel.prototype, 'saveVapidDetails').callsFake(
async () => {}
);
stub(
VapidDetailsModel.prototype,
'saveVapidDetails'
).callsFake(async () => {});

stub(TokenDetailsModel.prototype, 'getTokenDetailsFromSWScope').callsFake(
() => Promise.resolve(EXAMPLE_TOKEN_DETAILS_DEFAULT_VAPID)
);
stub(
TokenDetailsModel.prototype,
'getTokenDetailsFromSWScope'
).callsFake(() => Promise.resolve(EXAMPLE_TOKEN_DETAILS_DEFAULT_VAPID));

stub(serviceClass.prototype, 'getPushSubscription').callsFake(() =>
Promise.resolve(subscription)
Expand Down Expand Up @@ -496,9 +503,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
return Promise.resolve(EXAMPLE_TOKEN_DETAILS_DEFAULT_VAPID);
});

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

stub(SubscriptionManager.prototype, 'getToken').callsFake(() =>
Promise.resolve(GET_TOKEN_RESPONSE)
Expand All @@ -525,9 +533,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
() => 'granted'
);

stub(TokenDetailsModel.prototype, 'getTokenDetailsFromSWScope').callsFake(
() => Promise.resolve(EXAMPLE_EXPIRED_TOKEN_DETAILS)
);
stub(
TokenDetailsModel.prototype,
'getTokenDetailsFromSWScope'
).callsFake(() => Promise.resolve(EXAMPLE_EXPIRED_TOKEN_DETAILS));

stub(serviceClass.prototype, 'getPushSubscription').callsFake(() =>
Promise.resolve(subscription)
Expand All @@ -541,9 +550,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
Promise.resolve(DEFAULT_PUBLIC_VAPID_KEY)
);

stub(VapidDetailsModel.prototype, 'saveVapidDetails').callsFake(
async () => {}
);
stub(
VapidDetailsModel.prototype,
'saveVapidDetails'
).callsFake(async () => {});

stub(SubscriptionManager.prototype, 'updateToken').callsFake(() =>
Promise.reject(new Error(errorMsg))
Expand All @@ -555,9 +565,10 @@ describe('Firebase Messaging > *Controller.getToken()', () => {
return Promise.resolve(EXAMPLE_EXPIRED_TOKEN_DETAILS);
});

stub(SubscriptionManager.prototype, 'deleteToken').callsFake(
async () => {}
);
stub(
SubscriptionManager.prototype,
'deleteToken'
).callsFake(async () => {});

const serviceInstance = new serviceClass(app);
try {
Expand Down
11 changes: 4 additions & 7 deletions packages/remote-config/src/remote_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,10 @@ export class RemoteConfig implements RemoteConfigType {
return getAllKeys(
this._storageCache.getActiveConfig(),
this.defaultConfig
).reduce(
(allConfigs, key) => {
allConfigs[key] = this.getValue(key);
return allConfigs;
},
{} as { [key: string]: ValueType }
);
).reduce((allConfigs, key) => {
allConfigs[key] = this.getValue(key);
return allConfigs;
}, {} as { [key: string]: ValueType });
}

getBoolean(key: string): boolean {
Expand Down
7 changes: 6 additions & 1 deletion packages/rxfire/firestore/collection/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ const filterEmpty = filter(
* Splice arguments on top of a sliced array, to break top-level ===
* this is useful for change-detection
*/
function sliceAndSplice<T>(original: T[], start: number, deleteCount: number, ...args: T[]): T[] {
function sliceAndSplice<T>(
original: T[],
start: number,
deleteCount: number,
...args: T[]
): T[] {
const returnArray = original.slice();
returnArray.splice(start, deleteCount, ...args);
return returnArray;
Expand Down
Loading