Skip to content

Commit 5849598

Browse files
authored
Run prettier on whole repo (#1663)
1 parent e510af7 commit 5849598

File tree

8 files changed

+47
-19
lines changed

8 files changed

+47
-19
lines changed

packages/database/src/core/util/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const logClient = new Logger('@firebase/database');
3636
* Returns a locally-unique ID (generated by just incrementing up from 0 each time its called).
3737
* @type {function(): number} Generated ID.
3838
*/
39-
export const LUIDGenerator: (() => number) = (function() {
39+
export const LUIDGenerator: () => number = (function() {
4040
let id = 1;
4141
return function() {
4242
return id++;

packages/database/test/query.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,8 +1523,7 @@ describe('Query Tests', function() {
15231523
});
15241524

15251525
const snapAcc = EventAccumulatorFactory.waitsForCount(1);
1526-
f
1527-
.startAt(null)
1526+
f.startAt(null)
15281527
.endAt(null)
15291528
.on('value', snap => {
15301529
snapAcc.addEvent(snap.val());

packages/messaging/src/helpers/base64-to-array-buffer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
export function base64ToArrayBuffer(base64String: string): Uint8Array {
19-
const padding = '='.repeat((4 - base64String.length % 4) % 4);
19+
const padding = '='.repeat((4 - (base64String.length % 4)) % 4);
2020
const base64 = (base64String + padding)
2121
.replace(/\-/g, '+')
2222
.replace(/_/g, '/');

packages/rxfire/storage/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export function putString(
5858
export function percentage(task: storage.UploadTask) {
5959
return fromTask(task).pipe(
6060
map(s => ({
61-
progress: s.bytesTransferred / s.totalBytes * 100,
61+
progress: (s.bytesTransferred / s.totalBytes) * 100,
6262
snapshot: s
6363
}))
6464
);

packages/rxfire/test/database.test.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,10 @@ describe('RxFire Database', () => {
297297
const aref = ref(rando());
298298
const obs = list(aref, [ListenEvent.added]);
299299
obs
300-
.pipe(skip(1), take(1))
300+
.pipe(
301+
skip(1),
302+
take(1)
303+
)
301304
.subscribe(changes => {
302305
const data = changes.map(change => change.snapshot.val());
303306
expect(data[3]).to.eql({ name: 'anotha one' });
@@ -336,7 +339,10 @@ describe('RxFire Database', () => {
336339
const aref = ref(rando());
337340
const obs = list(aref.orderByChild('name'), [ListenEvent.added]);
338341
obs
339-
.pipe(skip(1), take(1))
342+
.pipe(
343+
skip(1),
344+
take(1)
345+
)
340346
.subscribe(changes => {
341347
const names = changes.map(change => change.snapshot.val().name);
342348
expect(names[0]).to.eql('anotha one');
@@ -358,7 +364,10 @@ describe('RxFire Database', () => {
358364
ListenEvent.added
359365
]);
360366
obs
361-
.pipe(skip(1), take(1))
367+
.pipe(
368+
skip(1),
369+
take(1)
370+
)
362371
.subscribe(changes => {
363372
const names = changes.map(change => change.snapshot.val().name);
364373
expect(names[0]).to.eql('zero');
@@ -378,7 +387,10 @@ describe('RxFire Database', () => {
378387
const aref = ref(rando());
379388
const obs = list(aref, [ListenEvent.added, ListenEvent.removed]);
380389
const sub = obs
381-
.pipe(skip(1), take(1))
390+
.pipe(
391+
skip(1),
392+
take(1)
393+
)
382394
.subscribe(changes => {
383395
const data = changes.map(change => change.snapshot.val());
384396
expect(data.length).to.eql(items.length - 1);
@@ -398,7 +410,10 @@ describe('RxFire Database', () => {
398410
const aref = ref(rando());
399411
const obs = list(aref, [ListenEvent.added, ListenEvent.changed]);
400412
const sub = obs
401-
.pipe(skip(1), take(1))
413+
.pipe(
414+
skip(1),
415+
take(1)
416+
)
402417
.subscribe(changes => {
403418
const data = changes.map(change => change.snapshot.val());
404419
expect(data[1].name).to.eql('lol');
@@ -418,7 +433,10 @@ describe('RxFire Database', () => {
418433
const aref = ref(rando());
419434
const obs = list(aref, [ListenEvent.added, ListenEvent.moved]);
420435
const sub = obs
421-
.pipe(skip(1), take(1))
436+
.pipe(
437+
skip(1),
438+
take(1)
439+
)
422440
.subscribe(changes => {
423441
const data = changes.map(change => change.snapshot.val());
424442
// We moved the first item to the last item, so we check that

packages/rxfire/test/firestore.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,14 @@ describe('RxFire Firestore', () => {
216216
it('should keep create a list of all changes', (done: MochaDone) => {
217217
const { colRef, expectedEvents, davidDoc } = seedTest(firestore);
218218

219-
const firstAudit = auditTrail(colRef).pipe(unwrapChange, take(1));
220-
const secondAudit = auditTrail(colRef).pipe(unwrapChange, skip(1));
219+
const firstAudit = auditTrail(colRef).pipe(
220+
unwrapChange,
221+
take(1)
222+
);
223+
const secondAudit = auditTrail(colRef).pipe(
224+
unwrapChange,
225+
skip(1)
226+
);
221227

222228
firstAudit.subscribe(list => {
223229
expect(list).to.eql(expectedEvents);
@@ -265,8 +271,14 @@ describe('RxFire Firestore', () => {
265271
it('should keep create a list of all changes', (done: MochaDone) => {
266272
const { colRef, expectedEvents, davidDoc } = seedTest(firestore);
267273

268-
const firstAudit = auditTrail(colRef).pipe(unwrapChange, take(1));
269-
const secondAudit = auditTrail(colRef).pipe(unwrapChange, skip(1));
274+
const firstAudit = auditTrail(colRef).pipe(
275+
unwrapChange,
276+
take(1)
277+
);
278+
const secondAudit = auditTrail(colRef).pipe(
279+
unwrapChange,
280+
skip(1)
281+
);
270282

271283
firstAudit.subscribe(list => {
272284
expect(list).to.eql(expectedEvents);

packages/webchannel-wrapper/tools/build.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ closureBuilder.build({
5757

5858
// esm build
5959
// We write the closure output to a temp file and then re-compile it with rollup.
60-
const filePath = `${tmpdir()}/index.js`
60+
const filePath = `${tmpdir()}/index.js`;
6161
closureBuilder.build(
6262
{
6363
name: 'firebase.webchannel.wrapper',
@@ -67,8 +67,7 @@ closureBuilder.build(
6767
out_source_map: `${filePath}.map`,
6868
options: {
6969
closure: {
70-
output_wrapper:
71-
'%output%\n//# sourceMappingURL=index.js.map',
70+
output_wrapper: '%output%\n//# sourceMappingURL=index.js.map',
7271
language_out: 'ECMASCRIPT5',
7372
compilation_level: 'ADVANCED',
7473
define: closureDefines

tools/gitHooks/prepush.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ git stash pop
3737

3838
(async () => {
3939
try {
40-
const hasDiff = !!await git.diff();
40+
const hasDiff = !!(await git.diff());
4141

4242
if (hasDiff) {
4343
console.error(notCleanTreeString);

0 commit comments

Comments
 (0)