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

Commit 892c17c

Browse files
TS tweaks
1 parent 7a25ec3 commit 892c17c

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

src/firebase.android.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { firebase } from "./firebase-common";
22
import * as appModule from "tns-core-modules/application";
33
import * as utils from "tns-core-modules/utils/utils";
4+
import lazy from "tns-core-modules/utils/lazy";
45
import * as frame from "tns-core-modules/ui/frame";
56
import * as fs from "tns-core-modules/file-system";
67
import { AndroidActivityResultEventData } from "tns-core-modules/application";
@@ -18,26 +19,9 @@ let fbCallbackManager = null;
1819
const GOOGLE_SIGNIN_INTENT_ID = 123;
1920
const REQUEST_INVITE_INTENT_ID = 48;
2021

21-
function lazy(action) {
22-
let _value;
23-
const that = this;
24-
25-
return function () {
26-
return that._value || (that._value = action());
27-
};
28-
}
29-
30-
const gson = new lazy(function () {
31-
return typeof(com.google.gson) === "undefined" ? null : new com.google.gson.Gson();
32-
});
33-
34-
const messagingEnabled = new lazy(function () {
35-
return typeof(com.google.firebase.messaging) !== "undefined";
36-
});
37-
38-
const dynamicLinksEnabled = new lazy(function () {
39-
return typeof(com.google.android.gms.appinvite) !== "undefined";
40-
});
22+
const gson = lazy(() => typeof(com.google.gson) === "undefined" ? null : new com.google.gson.Gson());
23+
const messagingEnabled = lazy(() => typeof(com.google.firebase.messaging) !== "undefined");
24+
const dynamicLinksEnabled = lazy(() => typeof(com.google.android.gms.appinvite) !== "undefined");
4125

4226
(function () {
4327
appModule.on("launch", function (args) {

src/firebase.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ firebase.analytics.logEvent = function (arg) {
700700
return;
701701
}
702702

703-
const dic: NSMutableDictionary<string, any> = NSMutableDictionary.new();
703+
const dic: any = NSMutableDictionary.new();
704704
if (arg.parameters !== undefined) {
705705
for (let p in arg.parameters) {
706706
const param = arg.parameters[p];
@@ -951,7 +951,7 @@ firebase.getRemoteConfig = function (arg) {
951951
// Enable developer mode to allow for frequent refreshes of the cache
952952
firebaseRemoteConfig.configSettings = new FIRRemoteConfigSettings({developerModeEnabled: arg.developerMode || false});
953953

954-
const dic: NSMutableDictionary<string, any> = NSMutableDictionary.new();
954+
const dic: any = NSMutableDictionary.new();
955955
for (let p in arg.properties) {
956956
const prop = arg.properties[p];
957957
if (prop.default !== undefined) {

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"preuninstall": "node preuninstall-hooks.js",
3636
"setup": "node scripts/postinstall.js setup",
3737
"config": "node scripts/postinstall.js config",
38-
"build": "npm i && tsc",
38+
"build": "tsc",
3939
"demo.ios": "npm run preparedemo && cd ../demo && tns run ios --emulator",
4040
"demo.ios.device": "npm run preparedemo && cd ../demo && tns platform remove ios && tns run ios",
4141
"demo.android": "npm run preparedemo && cd ../demo && tns platform remove android && tns run android --justlaunch",

src/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"noLib": false,
88
"emitDecoratorMetadata": true,
99
"experimentalDecorators": true,
10+
"skipLibCheck": true,
1011
"lib": [
1112
"es6",
1213
"dom"

0 commit comments

Comments
 (0)