@firebase/util 1.12.1-canary.2d720995d → 1.12.1-canary.f11b55294
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +11 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/{index.esm.js → index.esm2017.js} +12 -20
- package/dist/index.esm2017.js.map +1 -0
- package/dist/index.node.cjs.js +11 -19
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/node-esm/index.node.esm.js +11 -19
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/package.json +5 -5
- package/dist/index.esm.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -578,7 +578,7 @@ const getDefaults = () => {
|
|
|
578
578
|
* @returns a URL host formatted like `127.0.0.1:9999` or `[::1]:4000` if available
|
|
579
579
|
* @public
|
|
580
580
|
*/
|
|
581
|
-
const getDefaultEmulatorHost = (productName) => getDefaults()
|
|
581
|
+
const getDefaultEmulatorHost = (productName) => { var _a, _b; return (_b = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.emulatorHosts) === null || _b === void 0 ? void 0 : _b[productName]; };
|
|
582
582
|
/**
|
|
583
583
|
* Returns emulator hostname and port stored in the __FIREBASE_DEFAULTS__ object
|
|
584
584
|
* for the given product.
|
|
@@ -608,13 +608,13 @@ const getDefaultEmulatorHostnameAndPort = (productName) => {
|
|
|
608
608
|
* Returns Firebase app config stored in the __FIREBASE_DEFAULTS__ object.
|
|
609
609
|
* @public
|
|
610
610
|
*/
|
|
611
|
-
const getDefaultAppConfig = () => getDefaults()
|
|
611
|
+
const getDefaultAppConfig = () => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.config; };
|
|
612
612
|
/**
|
|
613
613
|
* Returns an experimental setting on the __FIREBASE_DEFAULTS__ object (properties
|
|
614
614
|
* prefixed by "_")
|
|
615
615
|
* @public
|
|
616
616
|
*/
|
|
617
|
-
const getExperimentalSetting = (name) => getDefaults()
|
|
617
|
+
const getExperimentalSetting = (name) => { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a[`_${name}`]; };
|
|
618
618
|
|
|
619
619
|
/**
|
|
620
620
|
* @license
|
|
@@ -702,7 +702,7 @@ function isCloudWorkstation(url) {
|
|
|
702
702
|
: url;
|
|
703
703
|
return host.endsWith('.cloudworkstations.dev');
|
|
704
704
|
}
|
|
705
|
-
catch {
|
|
705
|
+
catch (_a) {
|
|
706
706
|
return false;
|
|
707
707
|
}
|
|
708
708
|
}
|
|
@@ -749,22 +749,12 @@ function createMockUserToken(token, projectId) {
|
|
|
749
749
|
if (!sub) {
|
|
750
750
|
throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");
|
|
751
751
|
}
|
|
752
|
-
const payload = {
|
|
752
|
+
const payload = Object.assign({
|
|
753
753
|
// Set all required fields to decent defaults
|
|
754
|
-
iss: `https://securetoken.google.com/${project}`,
|
|
755
|
-
aud: project,
|
|
756
|
-
iat,
|
|
757
|
-
exp: iat + 3600,
|
|
758
|
-
auth_time: iat,
|
|
759
|
-
sub,
|
|
760
|
-
user_id: sub,
|
|
761
|
-
firebase: {
|
|
754
|
+
iss: `https://securetoken.google.com/${project}`, aud: project, iat, exp: iat + 3600, auth_time: iat, sub, user_id: sub, firebase: {
|
|
762
755
|
sign_in_provider: 'custom',
|
|
763
756
|
identities: {}
|
|
764
|
-
},
|
|
765
|
-
// Override with user options
|
|
766
|
-
...token
|
|
767
|
-
};
|
|
757
|
+
} }, token);
|
|
768
758
|
// Unsecured JWTs use the empty string as a signature.
|
|
769
759
|
const signature = '';
|
|
770
760
|
return [
|
|
@@ -970,7 +960,8 @@ function isMobileCordova() {
|
|
|
970
960
|
*/
|
|
971
961
|
// Node detection logic from: https://github.com/iliakan/detect-node/
|
|
972
962
|
function isNode() {
|
|
973
|
-
|
|
963
|
+
var _a;
|
|
964
|
+
const forceEnvironment = (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a.forceEnvironment;
|
|
974
965
|
if (forceEnvironment === 'node') {
|
|
975
966
|
return true;
|
|
976
967
|
}
|
|
@@ -1097,7 +1088,8 @@ function validateIndexedDBOpenable() {
|
|
|
1097
1088
|
preExist = false;
|
|
1098
1089
|
};
|
|
1099
1090
|
request.onerror = () => {
|
|
1100
|
-
|
|
1091
|
+
var _a;
|
|
1092
|
+
reject(((_a = request.error) === null || _a === void 0 ? void 0 : _a.message) || '');
|
|
1101
1093
|
};
|
|
1102
1094
|
}
|
|
1103
1095
|
catch (error) {
|