Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

api.js 864B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.realtimeOriginOrCustomUrl = exports.realtimeOriginOrEmulatorOrCustomUrl = void 0;
  4. const utils_1 = require("../utils");
  5. const constants_1 = require("../emulator/constants");
  6. function realtimeOriginOrEmulatorOrCustomUrl(host) {
  7. return (0, utils_1.envOverride)(constants_1.Constants.FIREBASE_DATABASE_EMULATOR_HOST, (0, utils_1.envOverride)("FIREBASE_REALTIME_URL", host), addHttpIfRequired);
  8. }
  9. exports.realtimeOriginOrEmulatorOrCustomUrl = realtimeOriginOrEmulatorOrCustomUrl;
  10. function realtimeOriginOrCustomUrl(host) {
  11. return (0, utils_1.envOverride)("FIREBASE_REALTIME_URL", host);
  12. }
  13. exports.realtimeOriginOrCustomUrl = realtimeOriginOrCustomUrl;
  14. function addHttpIfRequired(val) {
  15. if (val.startsWith("http")) {
  16. return val;
  17. }
  18. return `http://${val}`;
  19. }