@stemy/ngx-utils 11.2.2 → 11.2.3

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.
@@ -3158,6 +3158,14 @@
3158
3158
  }
3159
3159
  this.baseConfig = baseConfig || {};
3160
3160
  this.loadedConfig = Object.assign(!baseUrl ? {} : { baseUrl: baseUrl }, this.baseConfig);
3161
+ try {
3162
+ var url = new URL(this.loadedConfig.baseUrl);
3163
+ var port = url.port && url.port !== "443" && url.port !== "80" ? ":" + url.port : "";
3164
+ this.loadedConfig.baseDomain = url.protocol + "://" + url.hostname + port + "/";
3165
+ }
3166
+ catch (_a) {
3167
+ this.loadedConfig.baseDomain = "/";
3168
+ }
3161
3169
  this.scriptParameters = scriptParams || {};
3162
3170
  this.loaderFunc = function () {
3163
3171
  _this.loader = _this.loader || new Promise(function (resolve, reject) {
@@ -3218,7 +3226,8 @@
3218
3226
  var project = !this.loadedConfig ? "" : this.loadedConfig.project;
3219
3227
  url = url ? "" + url.replace(/\/+$/, "") + ending : ending;
3220
3228
  url = url.replace("[project]", project);
3221
- return this.universal.isServer && url.startsWith("//") ? "http:" + url : url;
3229
+ url = this.universal.isServer && url.startsWith("//") ? "http:" + url : url;
3230
+ return url.startsWith("/") ? this.loadedConfig.baseUrl + url.substr(1) : url;
3222
3231
  };
3223
3232
  ConfigService.prototype.getConfigValue = function (key) {
3224
3233
  return this.loadedConfig[key];