Skip to content

Commit dc60cbc

Browse files
committed
chore: clean up
1 parent 0228eae commit dc60cbc

File tree

9 files changed

+36
-29
lines changed

9 files changed

+36
-29
lines changed
Binary file not shown.

packages/firebase-database/index.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ export class Database implements IDatabase {
661661
this._persistenceCacheSizeBytes = bytes;
662662
} catch (e) {}
663663
}
664-
_persistenceEnabled: boolean = false;
664+
_persistenceEnabled = false;
665665
get persistenceEnabled(): boolean {
666666
return this._persistenceEnabled;
667667
}

packages/firebase-firestore/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function deserializeField(value) {
8686
}
8787

8888
if (value instanceof java.util.Map) {
89-
let dict = {};
89+
const dict = {};
9090
const keys = value.keySet().toArray();
9191
const size = keys.length;
9292
for (let i = 0, n = size; i < n; i++) {
@@ -1145,7 +1145,7 @@ export class FieldValue implements IFieldValue {
11451145
export class GeoPoint implements IGeoPoint {
11461146
_native: com.google.firebase.firestore.GeoPoint;
11471147

1148-
constructor(latitude: number, longitude: number, native: boolean = false) {
1148+
constructor(latitude: number, longitude: number, native = false) {
11491149
if (!native) {
11501150
this._native = new com.google.firebase.firestore.GeoPoint(latitude, longitude);
11511151
}

packages/firebase-installations/index.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class Installations implements IInstallations {
6060
);
6161
});
6262
}
63-
getToken(forceRefresh: boolean = false): Promise<string> {
63+
getToken(forceRefresh = false): Promise<string> {
6464
return new Promise((resolve, reject) => {
6565
org.nativescript.firebase.installations.FirebaseInstallations.getToken(
6666
this.native,

packages/firebase-messaging-core/index.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const onNotificationTapCallbacks: Set<(message: any) => void> = new Set();
5151

5252
let lastActivity: WeakRef<androidx.appcompat.app.AppCompatActivity>;
5353
let requestPermissionLauncher: androidx.activity.result.ActivityResultLauncher<any>;
54-
let _permissionQueue: { resolve: Function; reject: Function }[] = [];
54+
const _permissionQueue: { resolve: Function; reject: Function }[] = [];
5555

5656
function register(args: any) {
5757
if (!lastActivity) {

packages/firebase-storage/index.android.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,6 @@ export class Metadata implements IMetadata {
239239
return this.native.getBucket?.();
240240
}
241241

242-
get cacheControl(): string {
243-
return this.native.getCacheControl?.();
244-
}
245-
246242
private _createBuilder() {
247243
if (this._native) {
248244
this._builder = new com.google.firebase.storage.StorageMetadata.Builder(this._native);
@@ -251,6 +247,10 @@ export class Metadata implements IMetadata {
251247
}
252248
}
253249

250+
get cacheControl(): string {
251+
return this.native.getCacheControl?.();
252+
}
253+
254254
set cacheControl(value) {
255255
if (!this._builder) {
256256
this._createBuilder();
@@ -510,16 +510,18 @@ export class Reference implements IReference {
510510
putString(data: string, format: StringFormat = StringFormat.RAW, metadata?: Metadata): Task {
511511
switch (format) {
512512
case StringFormat.DATA_URL:
513-
const base64 = b64WithoutPrefix(data);
514-
const mime = getMIMEforBase64String(data);
515-
516-
const meta = metadata || new Metadata();
517-
if (!metadata.contentType) {
518-
meta.contentType = mime;
519-
}
513+
{
514+
const base64 = b64WithoutPrefix(data);
515+
const mime = getMIMEforBase64String(data);
520516

521-
org.nativescript.firebase.storage.FirebaseStorage.StorageReference.putString(this.native, base64, format, meta.native);
517+
const meta = metadata || new Metadata();
518+
if (!metadata.contentType) {
519+
meta.contentType = mime;
520+
}
522521

522+
org.nativescript.firebase.storage.FirebaseStorage.StorageReference.putString(this.native, base64, format, meta.native);
523+
}
524+
break;
523525
default:
524526
return Task.fromNative(org.nativescript.firebase.storage.FirebaseStorage.StorageReference.putString(this.native, data, format, metadata?.native || null));
525527
}

packages/firebase-storage/index.ios.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,14 +489,16 @@ export class Reference implements IReference {
489489
nsData = NSData.alloc().initWithBase64EncodedStringOptions(data, 0);
490490
break;
491491
case StringFormat.BASE64URL:
492-
let base64Encoded = data.replace(/-/g, '+').replace(/_/g, '/');
492+
{
493+
let base64Encoded = data.replace(/-/g, '+').replace(/_/g, '/');
493494

494-
while (base64Encoded.length % 4 != 0) {
495-
base64Encoded = base64Encoded + '=';
495+
while (base64Encoded.length % 4 != 0) {
496+
base64Encoded = base64Encoded + '=';
497+
}
498+
nsData = NSData.alloc().initWithBase64EncodedStringOptions(data, 0);
496499
}
497-
nsData = NSData.alloc().initWithBase64EncodedStringOptions(data, 0);
498500
break;
499-
case StringFormat.DATA_URL:
501+
case StringFormat.DATA_URL: {
500502
const base64 = b64WithoutPrefix(data);
501503
const mime = getMIMEforBase64String(data);
502504

@@ -505,12 +507,14 @@ export class Reference implements IReference {
505507
meta.contentType = mime;
506508
}
507509
return Task.fromNative(this.native.putDataMetadata(NSData.alloc().initWithBase64EncodedStringOptions(base64, 0), meta.native));
508-
default:
510+
}
511+
default: {
509512
const text = NSString.stringWithString(data);
510513
const nativeData = text.dataUsingEncoding(NSUTF8StringEncoding);
511514
const encodedString = nativeData.base64EncodedStringWithOptions(0);
512515
nsData = NSData.alloc().initWithBase64EncodedStringOptions(encodedString, 0);
513516
break;
517+
}
514518
}
515519

516520
if (metadata) {

packages/firebase-ui/index.ios.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,9 +185,10 @@ export class EmailProvider extends ProviderBase {
185185

186186
actionCodeSettings: ActionCodeSettings = null;
187187

188-
requireName: boolean = true;
188+
requireName = true;
189+
190+
_forceSameDevice = false;
189191

190-
_forceSameDevice: boolean = false;
191192
forceSameDevice() {
192193
this._forceSameDevice = true;
193194
return this;
@@ -199,9 +200,9 @@ export class EmailProvider extends ProviderBase {
199200
return this;
200201
}
201202

202-
defaultEmail: string = '';
203+
defaultEmail = '';
203204

204-
allowNewAccounts: boolean = true;
205+
allowNewAccounts = true;
205206

206207
getNative(ui: UI) {
207208
if (this.requireName) {
@@ -216,9 +217,9 @@ export class PhoneProvider extends ProviderBase {
216217
super();
217218
}
218219

219-
defaultNumber: string = '';
220+
defaultNumber = '';
220221

221-
defaultCountryIso: string = '';
222+
defaultCountryIso = '';
222223

223224
blacklistedCountries: string[] = [];
224225

Binary file not shown.

0 commit comments

Comments
 (0)