Skip to content

Run prettier on whole repo #1663

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
Apr 8, 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 @@ -36,7 +36,7 @@ const logClient = new Logger('@firebase/database');
* Returns a locally-unique ID (generated by just incrementing up from 0 each time its called).
* @type {function(): number} Generated ID.
*/
export const LUIDGenerator: (() => number) = (function() {
export const LUIDGenerator: () => number = (function() {
let id = 1;
return function() {
return id++;
Expand Down
3 changes: 1 addition & 2 deletions packages/database/test/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,7 @@ describe('Query Tests', function() {
});

const snapAcc = EventAccumulatorFactory.waitsForCount(1);
f
.startAt(null)
f.startAt(null)
.endAt(null)
.on('value', snap => {
snapAcc.addEvent(snap.val());
Expand Down
4 changes: 2 additions & 2 deletions packages/firebase/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7209,14 +7209,14 @@ declare namespace firebase.firestore {
/**
* Returns a special value that can be used with `set()` or `update()` that tells
* the server to increment the field's current value by the given value.
*
*
* If either the operand or the current field value uses floating point precision,
* all arithmetic follows IEEE 754 semantics. If both values are integers,
* values outside of JavaScript's safe number range (`Number.MIN_SAFE_INTEGER` to
* `Number.MAX_SAFE_INTEGER`) are also subject to precision loss. Furthermore,
* once processed by the Firestore backend, all integer operations are capped
* between -2^63 and 2^63-1.
*
*
* If the current field value is not of type `number`, or if the field does not
* yet exist, the transformation sets the field to the given value.
*
Expand Down
2 changes: 1 addition & 1 deletion packages/messaging/src/helpers/base64-to-array-buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

export function base64ToArrayBuffer(base64String: string): Uint8Array {
const padding = '='.repeat((4 - base64String.length % 4) % 4);
const padding = '='.repeat((4 - (base64String.length % 4)) % 4);
const base64 = (base64String + padding)
.replace(/\-/g, '+')
.replace(/_/g, '/');
Expand Down
2 changes: 1 addition & 1 deletion packages/rxfire/storage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function putString(
export function percentage(task: storage.UploadTask) {
return fromTask(task).pipe(
map(s => ({
progress: s.bytesTransferred / s.totalBytes * 100,
progress: (s.bytesTransferred / s.totalBytes) * 100,
snapshot: s
}))
);
Expand Down
30 changes: 24 additions & 6 deletions packages/rxfire/test/database.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,10 @@ describe('RxFire Database', () => {
const aref = ref(rando());
const obs = list(aref, [ListenEvent.added]);
obs
.pipe(skip(1), take(1))
.pipe(
skip(1),
take(1)
)
.subscribe(changes => {
const data = changes.map(change => change.snapshot.val());
expect(data[3]).to.eql({ name: 'anotha one' });
Expand Down Expand Up @@ -336,7 +339,10 @@ describe('RxFire Database', () => {
const aref = ref(rando());
const obs = list(aref.orderByChild('name'), [ListenEvent.added]);
obs
.pipe(skip(1), take(1))
.pipe(
skip(1),
take(1)
)
.subscribe(changes => {
const names = changes.map(change => change.snapshot.val().name);
expect(names[0]).to.eql('anotha one');
Expand All @@ -358,7 +364,10 @@ describe('RxFire Database', () => {
ListenEvent.added
]);
obs
.pipe(skip(1), take(1))
.pipe(
skip(1),
take(1)
)
.subscribe(changes => {
const names = changes.map(change => change.snapshot.val().name);
expect(names[0]).to.eql('zero');
Expand All @@ -378,7 +387,10 @@ describe('RxFire Database', () => {
const aref = ref(rando());
const obs = list(aref, [ListenEvent.added, ListenEvent.removed]);
const sub = obs
.pipe(skip(1), take(1))
.pipe(
skip(1),
take(1)
)
.subscribe(changes => {
const data = changes.map(change => change.snapshot.val());
expect(data.length).to.eql(items.length - 1);
Expand All @@ -398,7 +410,10 @@ describe('RxFire Database', () => {
const aref = ref(rando());
const obs = list(aref, [ListenEvent.added, ListenEvent.changed]);
const sub = obs
.pipe(skip(1), take(1))
.pipe(
skip(1),
take(1)
)
.subscribe(changes => {
const data = changes.map(change => change.snapshot.val());
expect(data[1].name).to.eql('lol');
Expand All @@ -418,7 +433,10 @@ describe('RxFire Database', () => {
const aref = ref(rando());
const obs = list(aref, [ListenEvent.added, ListenEvent.moved]);
const sub = obs
.pipe(skip(1), take(1))
.pipe(
skip(1),
take(1)
)
.subscribe(changes => {
const data = changes.map(change => change.snapshot.val());
// We moved the first item to the last item, so we check that
Expand Down
20 changes: 16 additions & 4 deletions packages/rxfire/test/firestore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,14 @@ describe('RxFire Firestore', () => {
it('should keep create a list of all changes', (done: MochaDone) => {
const { colRef, expectedEvents, davidDoc } = seedTest(firestore);

const firstAudit = auditTrail(colRef).pipe(unwrapChange, take(1));
const secondAudit = auditTrail(colRef).pipe(unwrapChange, skip(1));
const firstAudit = auditTrail(colRef).pipe(
unwrapChange,
take(1)
);
const secondAudit = auditTrail(colRef).pipe(
unwrapChange,
skip(1)
);

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

const firstAudit = auditTrail(colRef).pipe(unwrapChange, take(1));
const secondAudit = auditTrail(colRef).pipe(unwrapChange, skip(1));
const firstAudit = auditTrail(colRef).pipe(
unwrapChange,
take(1)
);
const secondAudit = auditTrail(colRef).pipe(
unwrapChange,
skip(1)
);

firstAudit.subscribe(list => {
expect(list).to.eql(expectedEvents);
Expand Down
5 changes: 2 additions & 3 deletions packages/webchannel-wrapper/tools/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ closureBuilder.build({

// esm build
// We write the closure output to a temp file and then re-compile it with rollup.
const filePath = `${tmpdir()}/index.js`
const filePath = `${tmpdir()}/index.js`;
closureBuilder.build(
{
name: 'firebase.webchannel.wrapper',
Expand All @@ -67,8 +67,7 @@ closureBuilder.build(
out_source_map: `${filePath}.map`,
options: {
closure: {
output_wrapper:
'%output%\n//# sourceMappingURL=index.js.map',
output_wrapper: '%output%\n//# sourceMappingURL=index.js.map',
language_out: 'ECMASCRIPT5',
compilation_level: 'ADVANCED',
define: closureDefines
Expand Down
2 changes: 1 addition & 1 deletion tools/gitHooks/prepush.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ $ git stash pop

(async () => {
try {
const hasDiff = !!await git.diff();
const hasDiff = !!(await git.diff());

if (hasDiff) {
console.error(notCleanTreeString);
Expand Down