@putkoff/abstract-utilities 1.0.2 → 1.0.4

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/esm/index.js CHANGED
@@ -1984,7 +1984,7 @@ function Spinner() {
1984
1984
  let _cachedConfig = null;
1985
1985
  function loadConfig() {
1986
1986
  return __awaiter(this, arguments, void 0, function* (filePath = null) {
1987
- var _a;
1987
+ var _a, _b;
1988
1988
  if (_cachedConfig) {
1989
1989
  return _cachedConfig;
1990
1990
  }
@@ -1996,9 +1996,11 @@ function loadConfig() {
1996
1996
  else if (typeof import.meta !== 'undefined' && typeof import.meta.url === 'string') {
1997
1997
  // ES module: resolve relative to this file
1998
1998
  try {
1999
- configUrl = new URL('./config.json', import.meta.url).href;
1999
+ const mod = yield (new Function("return import('./config.json').catch(() => ({}))"))();
2000
+ _cachedConfig = (_a = mod.default) !== null && _a !== void 0 ? _a : {};
2001
+ return _cachedConfig;
2000
2002
  }
2001
- catch (_b) {
2003
+ catch (_c) {
2002
2004
  configUrl = 'config.json';
2003
2005
  }
2004
2006
  }
@@ -2011,7 +2013,7 @@ function loadConfig() {
2011
2013
  ? new URL('config.json', baseURI).href
2012
2014
  : 'config.json';
2013
2015
  }
2014
- catch (_c) {
2016
+ catch (_d) {
2015
2017
  configUrl = 'config.json';
2016
2018
  }
2017
2019
  }
@@ -2023,11 +2025,11 @@ function loadConfig() {
2023
2025
  if (res.ok) {
2024
2026
  const json = yield res.json();
2025
2027
  // cache & return
2026
- _cachedConfig = (_a = json) !== null && _a !== void 0 ? _a : {};
2028
+ _cachedConfig = (_b = json) !== null && _b !== void 0 ? _b : {};
2027
2029
  return _cachedConfig;
2028
2030
  }
2029
2031
  }
2030
- catch (_d) {
2032
+ catch (_e) {
2031
2033
  /* swallow */
2032
2034
  }
2033
2035
  }
@@ -2037,7 +2039,7 @@ function loadConfig() {
2037
2039
  _cachedConfig = disk !== null && disk !== void 0 ? disk : {};
2038
2040
  return _cachedConfig;
2039
2041
  }
2040
- catch (_e) {
2042
+ catch (_f) {
2041
2043
  /* swallow */
2042
2044
  }
2043
2045
  // 4) if all else fails, return an empty config