@putkoff/abstract-utilities 1.0.66 → 1.0.67
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
|
@@ -224,7 +224,7 @@ function fetchIt(endpoint_1) {
|
|
|
224
224
|
return __awaiter(this, arguments, void 0, function* (endpoint, body = null, method = null, headers = null, blob = false, configUrl = false, withCredentials = true, returnJson = true, returnReult = true) {
|
|
225
225
|
method = (method || "GET").toUpperCase();
|
|
226
226
|
// 2) choose the URL
|
|
227
|
-
|
|
227
|
+
const url = endpoint;
|
|
228
228
|
// 3) prepare headers & body
|
|
229
229
|
headers = Object.assign(Object.assign({}, (body instanceof FormData ? {} : { "Content-Type": "application/json" })), headers);
|
|
230
230
|
const opts = {
|
|
@@ -1467,9 +1467,9 @@ function capitalize_str(string) {
|
|
|
1467
1467
|
function capitalize(string) {
|
|
1468
1468
|
let nu_string = '';
|
|
1469
1469
|
string = assureString(string);
|
|
1470
|
-
|
|
1470
|
+
const objs = string.replace('-', '_').split('_');
|
|
1471
1471
|
for (const obj of objs) {
|
|
1472
|
-
|
|
1472
|
+
const str_obj = capitalize_str(obj);
|
|
1473
1473
|
nu_string = `${nu_string} ${str_obj}`;
|
|
1474
1474
|
}
|
|
1475
1475
|
return eatAll(nu_string, [' ']);
|
|
@@ -1552,7 +1552,7 @@ function get_alpha_ints(opts) {
|
|
|
1552
1552
|
function eatElse(stringObj, chars, ints = true, alpha = true, lower = true, capitalize = true, string = true, listObj = true) {
|
|
1553
1553
|
stringObj = String(stringObj);
|
|
1554
1554
|
const alphaInts = get_alpha_ints();
|
|
1555
|
-
|
|
1555
|
+
const ls = ensure_list(chars || []).concat(alphaInts);
|
|
1556
1556
|
while (true) {
|
|
1557
1557
|
if (!stringObj)
|
|
1558
1558
|
return stringObj;
|
|
@@ -2132,7 +2132,6 @@ function callStorage(method, ...args) {
|
|
|
2132
2132
|
if (typeof fn !== 'function')
|
|
2133
2133
|
return undefined;
|
|
2134
2134
|
try {
|
|
2135
|
-
// @ts-ignore – TS can’t infer that this is callable
|
|
2136
2135
|
return fn.apply(storage, args);
|
|
2137
2136
|
}
|
|
2138
2137
|
catch (_a) {
|
|
@@ -2148,7 +2147,6 @@ function safeStorage(storageName, method, ...args) {
|
|
|
2148
2147
|
const store = safeGlobalProp(storageName);
|
|
2149
2148
|
if (!store || typeof store[method] !== "function")
|
|
2150
2149
|
return undefined;
|
|
2151
|
-
// @ts-ignore
|
|
2152
2150
|
return store[method](...args);
|
|
2153
2151
|
}
|
|
2154
2152
|
catch (_a) {
|