@putkoff/abstract-utilities 0.1.122 → 0.1.123

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.
@@ -1,3 +1,2 @@
1
1
  export * from './functions';
2
2
  export * from './types';
3
- export { loadConfig } from './utils';
package/dist/cjs/index.js CHANGED
@@ -4,50 +4,6 @@ var react = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
- /******************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
22
-
23
-
24
- function __rest(s, e) {
25
- var t = {};
26
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
27
- t[p] = s[p];
28
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
29
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
30
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
31
- t[p[i]] = s[p[i]];
32
- }
33
- return t;
34
- }
35
-
36
- function __awaiter(thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- }
45
-
46
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
47
- var e = new Error(message);
48
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
- };
50
-
51
7
  /**
52
8
  ***Changes**:
53
9
  *- Updated import path for `InputProps` to `../../types/interfaces`.
@@ -199,6 +155,50 @@ function get_window_parts() {
199
155
  return null;
200
156
  }
201
157
 
158
+ /******************************************************************************
159
+ Copyright (c) Microsoft Corporation.
160
+
161
+ Permission to use, copy, modify, and/or distribute this software for any
162
+ purpose with or without fee is hereby granted.
163
+
164
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
165
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
166
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
167
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
168
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
169
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
170
+ PERFORMANCE OF THIS SOFTWARE.
171
+ ***************************************************************************** */
172
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
173
+
174
+
175
+ function __rest(s, e) {
176
+ var t = {};
177
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
178
+ t[p] = s[p];
179
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
180
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
181
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
182
+ t[p[i]] = s[p[i]];
183
+ }
184
+ return t;
185
+ }
186
+
187
+ function __awaiter(thisArg, _arguments, P, generator) {
188
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
189
+ return new (P || (P = Promise))(function (resolve, reject) {
190
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
191
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
192
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
193
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
194
+ });
195
+ }
196
+
197
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
198
+ var e = new Error(message);
199
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
200
+ };
201
+
202
202
  function assertPath(path) {
203
203
  if (typeof path !== 'string') {
204
204
  throw new TypeError('Path must be a string. Received ' + JSON.stringify(path));
@@ -1017,7 +1017,7 @@ function alertit(obj = null) {
1017
1017
  }
1018
1018
 
1019
1019
  let _cachedConfig = null;
1020
- function loadConfig$1() {
1020
+ function loadConfig() {
1021
1021
  return __awaiter(this, arguments, void 0, function* (filePath = null) {
1022
1022
  // 1. If nobody passed a custom path, we default to "config.json" (relative)
1023
1023
  const relativePath = filePath || 'config.json';
@@ -1036,7 +1036,7 @@ function loadConfig$1() {
1036
1036
  }
1037
1037
  function getConfig(key) {
1038
1038
  return __awaiter(this, void 0, void 0, function* () {
1039
- const cfg = yield loadConfig$1();
1039
+ const cfg = yield loadConfig();
1040
1040
  return key ? cfg[key] : cfg;
1041
1041
  });
1042
1042
  }
@@ -1344,21 +1344,6 @@ function readJsonFile(relativeOrAbsolutePath) {
1344
1344
  });
1345
1345
  }
1346
1346
 
1347
- function loadConfig() {
1348
- return __awaiter(this, void 0, void 0, function* () {
1349
- const base = (process.env.BASE_API_URL || "").replace(/\/+$/, "");
1350
- const url = `${base}/config.json`;
1351
- const res = yield fetch(url);
1352
- if (!res.ok)
1353
- throw new Error(`Failed to load ${url}: ${res.status}`);
1354
- yield res.json();
1355
- });
1356
- }
1357
-
1358
- (() => __awaiter(void 0, void 0, void 0, function* () {
1359
- console.log(yield get_app_config_url('api'));
1360
- }))(); // ← note the () here to invoke it
1361
-
1362
1347
  Object.defineProperty(exports, "useCallback", {
1363
1348
  enumerable: true,
1364
1349
  get: function () { return react.useCallback; }
@@ -1439,7 +1424,6 @@ exports.get_window_parts = get_window_parts;
1439
1424
  exports.get_window_pathname = get_window_pathname;
1440
1425
  exports.isLoggedIn = isLoggedIn;
1441
1426
  exports.isTokenExpired = isTokenExpired;
1442
- exports.loadConfig = loadConfig;
1443
1427
  exports.make_path = make_path;
1444
1428
  exports.make_sanitized_path = make_sanitized_path;
1445
1429
  exports.normalizeUrl = normalizeUrl;