@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/cjs/index.js
CHANGED
|
@@ -238,7 +238,7 @@ function fetchIt(endpoint_1) {
|
|
|
238
238
|
return __awaiter(this, arguments, void 0, function* (endpoint, body = null, method = null, headers = null, blob = false, configUrl = false, withCredentials = true, returnJson = true, returnReult = true) {
|
|
239
239
|
method = (method || "GET").toUpperCase();
|
|
240
240
|
// 2) choose the URL
|
|
241
|
-
|
|
241
|
+
const url = endpoint;
|
|
242
242
|
// 3) prepare headers & body
|
|
243
243
|
headers = Object.assign(Object.assign({}, (body instanceof FormData ? {} : { "Content-Type": "application/json" })), headers);
|
|
244
244
|
const opts = {
|
|
@@ -1440,9 +1440,9 @@ function capitalize_str(string) {
|
|
|
1440
1440
|
function capitalize(string) {
|
|
1441
1441
|
let nu_string = '';
|
|
1442
1442
|
string = assureString(string);
|
|
1443
|
-
|
|
1443
|
+
const objs = string.replace('-', '_').split('_');
|
|
1444
1444
|
for (const obj of objs) {
|
|
1445
|
-
|
|
1445
|
+
const str_obj = capitalize_str(obj);
|
|
1446
1446
|
nu_string = `${nu_string} ${str_obj}`;
|
|
1447
1447
|
}
|
|
1448
1448
|
return eatAll(nu_string, [' ']);
|
|
@@ -1525,7 +1525,7 @@ function get_alpha_ints(opts) {
|
|
|
1525
1525
|
function eatElse(stringObj, chars, ints = true, alpha = true, lower = true, capitalize = true, string = true, listObj = true) {
|
|
1526
1526
|
stringObj = String(stringObj);
|
|
1527
1527
|
const alphaInts = get_alpha_ints();
|
|
1528
|
-
|
|
1528
|
+
const ls = ensure_list(chars || []).concat(alphaInts);
|
|
1529
1529
|
while (true) {
|
|
1530
1530
|
if (!stringObj)
|
|
1531
1531
|
return stringObj;
|
|
@@ -2105,7 +2105,6 @@ function callStorage(method, ...args) {
|
|
|
2105
2105
|
if (typeof fn !== 'function')
|
|
2106
2106
|
return undefined;
|
|
2107
2107
|
try {
|
|
2108
|
-
// @ts-ignore – TS can’t infer that this is callable
|
|
2109
2108
|
return fn.apply(storage, args);
|
|
2110
2109
|
}
|
|
2111
2110
|
catch (_a) {
|
|
@@ -2121,7 +2120,6 @@ function safeStorage(storageName, method, ...args) {
|
|
|
2121
2120
|
const store = safeGlobalProp(storageName);
|
|
2122
2121
|
if (!store || typeof store[method] !== "function")
|
|
2123
2122
|
return undefined;
|
|
2124
|
-
// @ts-ignore
|
|
2125
2123
|
return store[method](...args);
|
|
2126
2124
|
}
|
|
2127
2125
|
catch (_a) {
|