@putkoff/abstract-utilities 0.1.240 → 0.1.241

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
@@ -514,7 +514,6 @@ function fetchIt(endpoint_1) {
514
514
  ? JSON.stringify(body)
515
515
  : undefined,
516
516
  };
517
- console.debug("➡️ secureFetchIt →", url, opts);
518
517
  let res = yield fetch(url, opts);
519
518
  if (!res.ok) {
520
519
  const err = yield res.text();
@@ -1511,6 +1510,23 @@ function make_path(...paths) {
1511
1510
  }
1512
1511
  return real_path;
1513
1512
  }
1513
+ function makePath(...paths) {
1514
+ var _a;
1515
+ const pathArray = ensure_list(paths);
1516
+ let real_path = '';
1517
+ for (let i = 0; i < pathArray.length; i++) {
1518
+ let seg = String((_a = pathArray[i]) !== null && _a !== void 0 ? _a : '');
1519
+ if (i === 0) {
1520
+ real_path = seg;
1521
+ }
1522
+ else {
1523
+ seg = eatInner(seg, ['/']);
1524
+ real_path = eatOuter(real_path, ['/']);
1525
+ real_path = `${real_path}/${seg}`;
1526
+ }
1527
+ }
1528
+ return real_path || '';
1529
+ }
1514
1530
  function sanitizeFilename(filename) {
1515
1531
  return filename
1516
1532
  .toLowerCase()
@@ -1540,13 +1556,13 @@ function make_sanitized_path(...paths) {
1540
1556
  }
1541
1557
  return real_path || '';
1542
1558
  }
1559
+ /** FIXED: your regexes were strings. This correctly joins without duplicate slashes. */
1543
1560
  function normalizeUrl(base, p) {
1544
1561
  if (!p)
1545
- return base;
1546
- const cleanBase = base.replace(/\/+$/, ''); // regex literal
1547
- const cleanPath = p.replace(/^\/+/, '');
1548
- // collapse multiple “//” into one, but keep the “://” after protocol
1549
- return `${cleanBase}/${cleanPath}`.replace(/([^:])\/{2,}/g, '$1/');
1562
+ return base.replace(/\/+$/g, '');
1563
+ const cleanBase = base.replace(/\/+$/g, '');
1564
+ const cleanPath = p.replace(/^\/+/g, '');
1565
+ return `${cleanBase}/${cleanPath}`.replace(/([^:])\/{2,}/g, '$1/'); // keep protocol //
1550
1566
  }
1551
1567
 
1552
1568
  /**
@@ -1829,5 +1845,5 @@ const encodeTextForUrl = (text) => encode(text);
1829
1845
  /** Quick helper: decode long blobs coming from share-intents/UTMs */
1830
1846
  const decodeShareBlob = (blob) => decodeMaybeDouble(blob).replace(/\r\n/g, "\n");
1831
1847
 
1832
- export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertIt, alertit, assureArray, assureList, assureNumber, assureString, assure_array, assure_list, assure_number, assure_string, buildUrl, callStorage, callWindowMethod, capitalize, capitalize_str, checkResponse, cleanArray, cleanText, create_list_string, currentUsername, currentUsernames, decodeFormComponent, decodeJwt, decodeMaybeDouble, decodeSafe, decodeShareBlob, eatAll, eatEnd, eatInner, eatOuter, encode, encodeTextForUrl, ensureArray, ensureList, ensureNumber, ensureString, ensure_array, ensure_list, ensure_number, ensure_string, fetchIndexHtml, fetchIndexHtmlContainer, fetchIt, formatNumber, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, get, getAbsDir, getAbsPath, getAlphaNum, getAlphas, getAuthorizationHeader, getBaseDir, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfigContent, getConfigJson, getConfigVar, getDbConfigsPath, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMethod, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, getWindowHost, getWindowProp, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_relative_path, get_result, get_safe_path, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isNum, isStrInString, isTokenExpired, isType, make_path, make_sanitized_path, normalizeUrl, parseQuery, parseResult, path_to_url, processKeywords, readJsonFile, removeToken, requireToken, roundPercentage, safeDivide, safeGlobalProp, safeMultiply, safeNums, safeStorage, sanitizeFilename, stripPrefixes, truncateString, tryParse, urlJoin, url_to_path };
1848
+ export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertIt, alertit, assureArray, assureList, assureNumber, assureString, assure_array, assure_list, assure_number, assure_string, buildUrl, callStorage, callWindowMethod, capitalize, capitalize_str, checkResponse, cleanArray, cleanText, create_list_string, currentUsername, currentUsernames, decodeFormComponent, decodeJwt, decodeMaybeDouble, decodeSafe, decodeShareBlob, eatAll, eatEnd, eatInner, eatOuter, encode, encodeTextForUrl, ensureArray, ensureList, ensureNumber, ensureString, ensure_array, ensure_list, ensure_number, ensure_string, fetchIndexHtml, fetchIndexHtmlContainer, fetchIt, formatNumber, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, get, getAbsDir, getAbsPath, getAlphaNum, getAlphas, getAuthorizationHeader, getBaseDir, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfigContent, getConfigJson, getConfigVar, getDbConfigsPath, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMethod, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, getWindowHost, getWindowProp, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_relative_path, get_result, get_safe_path, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isNum, isStrInString, isTokenExpired, isType, makePath, make_path, make_sanitized_path, normalizeUrl, parseQuery, parseResult, path_to_url, processKeywords, readJsonFile, removeToken, requireToken, roundPercentage, safeDivide, safeGlobalProp, safeMultiply, safeNums, safeStorage, sanitizeFilename, stripPrefixes, truncateString, tryParse, urlJoin, url_to_path };
1833
1849
  //# sourceMappingURL=index.js.map