Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Oct 10, 2018
1 parent 14bec6e commit 5fb847e
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 145 deletions.
2 changes: 1 addition & 1 deletion demo-ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"nativescript-angular": "^6.1.0",
"nativescript-camera": "^4.0.2",
"nativescript-imagepicker": "~6.0.4",
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.4.tgz",
"nativescript-plugin-firebase": "file:../publish/package/nativescript-plugin-firebase-7.1.5.tgz",
"nativescript-theme-core": "~1.0.4",
"reflect-metadata": "~0.1.10",
"rxjs": "~6.0.0 || >=6.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app/database/util/NextPushId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* this by using the previous random bits but "incrementing" them by 1 (only
* in the case of a timestamp collision).
*/
export const nextPushId = (function() {
export const nextPushId = (function () {
// Modeled after base64 web-safe chars, but ordered by ASCII.
const PUSH_CHARS =
'-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz';
Expand All @@ -29,7 +29,7 @@ export const nextPushId = (function() {
// we'll use those same characters except "incremented" by one.
const lastRandChars: number[] = [];

return function(now: number) {
return function (now: number) {
const duplicateTime = now === lastPushTime;
lastPushTime = now;

Expand Down
20 changes: 9 additions & 11 deletions src/firebase-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ import * as mlkit from "./mlkit";

// note that this implementation is overridden for iOS
export class FieldValue {
constructor(
public type: firestore.FieldValueType,
public value: any,
) { }
constructor(public type: firestore.FieldValueType,
public value: any) {
}

static serverTimestamp = () => "SERVER_TIMESTAMP";
static arrayUnion = (fields: Array<any>) => new FieldValue("ARRAY_UNION", fields);
static arrayRemove = (fields: Array<any>) => new FieldValue("ARRAY_REMOVE", fields);
}

export class GeoPoint {
constructor(public latitude: number, public longitude: number) {
constructor(public latitude: number,
public longitude: number) {
}
}

Expand Down Expand Up @@ -206,12 +206,10 @@ export const firebase: any = {
export abstract class DocumentSnapshot implements firestore.DocumentSnapshot {
public data: () => firestore.DocumentData;

constructor(
public id: string,
public exists: boolean,
documentData: firestore.DocumentData,
public ref: firestore.DocumentReference,
) {
constructor(public id: string,
public exists: boolean,
documentData: firestore.DocumentData,
public ref: firestore.DocumentReference) {
this.data = () => exists ? documentData : undefined;
}
}
Expand Down
Loading

0 comments on commit 5fb847e

Please sign in to comment.