@firebase/util 1.7.3-canary.6efd96b78 → 1.7.3-canary.7e237cd47
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.node.cjs.js
CHANGED
|
@@ -696,7 +696,7 @@ var getDefaults = function () {
|
|
|
696
696
|
* info instead of swallowing so we can find these unknown cases
|
|
697
697
|
* and add paths for them if needed.
|
|
698
698
|
*/
|
|
699
|
-
console.info("Unable to get __FIREBASE_DEFAULTS__ due to: "
|
|
699
|
+
console.info("Unable to get __FIREBASE_DEFAULTS__ due to: ".concat(e));
|
|
700
700
|
return;
|
|
701
701
|
}
|
|
702
702
|
};
|
|
@@ -720,7 +720,7 @@ var getDefaultEmulatorHostnameAndPort = function (productName) {
|
|
|
720
720
|
}
|
|
721
721
|
var separatorIndex = host.lastIndexOf(':'); // Finding the last since IPv6 addr also has colons.
|
|
722
722
|
if (separatorIndex <= 0 || separatorIndex + 1 === host.length) {
|
|
723
|
-
throw new Error("Invalid host "
|
|
723
|
+
throw new Error("Invalid host ".concat(host, " with no separate hostname and port!"));
|
|
724
724
|
}
|
|
725
725
|
// eslint-disable-next-line no-restricted-globals
|
|
726
726
|
var port = parseInt(host.substring(separatorIndex + 1), 10);
|
|
@@ -742,7 +742,7 @@ var getDefaultAppConfig = function () { var _a; return (_a = getDefaults()) ===
|
|
|
742
742
|
* prefixed by "_")
|
|
743
743
|
* @public
|
|
744
744
|
*/
|
|
745
|
-
var getExperimentalSetting = function (name) { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a["_"
|
|
745
|
+
var getExperimentalSetting = function (name) { var _a; return (_a = getDefaults()) === null || _a === void 0 ? void 0 : _a["_".concat(name)]; };
|
|
746
746
|
|
|
747
747
|
/**
|
|
748
748
|
* @license
|
|
@@ -835,7 +835,7 @@ function createMockUserToken(token, projectId) {
|
|
|
835
835
|
}
|
|
836
836
|
var payload = tslib.__assign({
|
|
837
837
|
// Set all required fields to decent defaults
|
|
838
|
-
iss: "https://securetoken.google.com/"
|
|
838
|
+
iss: "https://securetoken.google.com/".concat(project), aud: project, iat: iat, exp: iat + 3600, auth_time: iat, sub: sub, user_id: sub, firebase: {
|
|
839
839
|
sign_in_provider: 'custom',
|
|
840
840
|
identities: {}
|
|
841
841
|
} }, token);
|
|
@@ -903,11 +903,11 @@ var ErrorFactory = /** @class */ (function () {
|
|
|
903
903
|
data[_i - 1] = arguments[_i];
|
|
904
904
|
}
|
|
905
905
|
var customData = data[0] || {};
|
|
906
|
-
var fullCode = this.service
|
|
906
|
+
var fullCode = "".concat(this.service, "/").concat(code);
|
|
907
907
|
var template = this.errors[code];
|
|
908
908
|
var message = template ? replaceTemplate(template, customData) : 'Error';
|
|
909
909
|
// Service Name: Error message (service/code).
|
|
910
|
-
var fullMessage = this.serviceName
|
|
910
|
+
var fullMessage = "".concat(this.serviceName, ": ").concat(message, " (").concat(fullCode, ").");
|
|
911
911
|
var error = new FirebaseError(fullCode, fullMessage, customData);
|
|
912
912
|
return error;
|
|
913
913
|
};
|
|
@@ -916,7 +916,7 @@ var ErrorFactory = /** @class */ (function () {
|
|
|
916
916
|
function replaceTemplate(template, data) {
|
|
917
917
|
return template.replace(PATTERN, function (_, key) {
|
|
918
918
|
var value = data[key];
|
|
919
|
-
return value != null ? String(value) : "<"
|
|
919
|
+
return value != null ? String(value) : "<".concat(key, "?>");
|
|
920
920
|
});
|
|
921
921
|
}
|
|
922
922
|
var PATTERN = /\{\$([^}]+)}/g;
|
|
@@ -1773,7 +1773,7 @@ var validateArgCount = function (fnName, minCount, maxCount, argCount) {
|
|
|
1773
1773
|
* @return The prefix to add to the error thrown for validation.
|
|
1774
1774
|
*/
|
|
1775
1775
|
function errorPrefix(fnName, argName) {
|
|
1776
|
-
return fnName
|
|
1776
|
+
return "".concat(fnName, " failed: ").concat(argName, " argument ");
|
|
1777
1777
|
}
|
|
1778
1778
|
/**
|
|
1779
1779
|
* @param fnName
|
|
@@ -2015,7 +2015,7 @@ function calculateBackoffMillis(backoffCount, intervalMillis, backoffFactor) {
|
|
|
2015
2015
|
*/
|
|
2016
2016
|
function ordinal(i) {
|
|
2017
2017
|
if (!Number.isFinite(i)) {
|
|
2018
|
-
return ""
|
|
2018
|
+
return "".concat(i);
|
|
2019
2019
|
}
|
|
2020
2020
|
return i + indicator(i);
|
|
2021
2021
|
}
|