@putkoff/abstract-utilities 0.1.244 → 1.0.0

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.
Files changed (186) hide show
  1. package/dist/cjs/index.js +262 -346
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +261 -330
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/index.d.ts +14 -40
  6. package/dist/types/functions/auth_utils/imports.d.ts +0 -0
  7. package/dist/types/functions/auth_utils/index.d.ts +0 -0
  8. package/dist/types/functions/auth_utils/src/index.d.ts +0 -0
  9. package/dist/types/functions/auth_utils/src/token_utils.d.ts +0 -1
  10. package/dist/types/functions/config_utils/imports.d.ts +0 -0
  11. package/dist/types/functions/config_utils/index.d.ts +0 -0
  12. package/dist/types/functions/config_utils/src/config_utils.d.ts +6 -2
  13. package/dist/types/functions/config_utils/src/index.d.ts +0 -0
  14. package/dist/types/functions/constants_utils/index.d.ts +0 -0
  15. package/dist/types/functions/constants_utils/src/constants.d.ts +0 -0
  16. package/dist/types/functions/constants_utils/src/index.d.ts +0 -0
  17. package/dist/types/functions/env_utils/imports.d.ts +0 -0
  18. package/dist/types/functions/env_utils/index.d.ts +0 -0
  19. package/dist/types/functions/env_utils/src/index.d.ts +0 -0
  20. package/dist/types/functions/env_utils/src/window_utils.d.ts +0 -0
  21. package/dist/types/functions/fetch_utils/imports.d.ts +0 -0
  22. package/dist/types/functions/fetch_utils/index.d.ts +0 -0
  23. package/dist/types/functions/fetch_utils/src/fetch_utils.d.ts +2 -2
  24. package/dist/types/functions/fetch_utils/src/index.d.ts +0 -0
  25. package/dist/types/functions/fetch_utils/src/url_utils.d.ts +0 -0
  26. package/dist/types/functions/fetch_utils/src/utils.d.ts +1 -2
  27. package/dist/types/functions/index.d.ts +1 -2
  28. package/dist/types/functions/math_utils/index.d.ts +0 -0
  29. package/dist/types/functions/math_utils/safe_math.d.ts +0 -0
  30. package/dist/types/functions/path_utils/imports.d.ts +0 -0
  31. package/dist/types/functions/path_utils/index.d.ts +0 -0
  32. package/dist/types/functions/path_utils/src/base_dirs.d.ts +0 -0
  33. package/dist/types/functions/path_utils/src/function_dirs.d.ts +0 -0
  34. package/dist/types/functions/path_utils/src/index.d.ts +0 -0
  35. package/dist/types/functions/path_utils/src/misc_dirs.d.ts +0 -0
  36. package/dist/types/functions/path_utils/src/path_utils.d.ts +0 -4
  37. package/dist/types/functions/path_utils/src/paths.d.ts +0 -0
  38. package/dist/types/functions/path_utils/src/src_dirs.d.ts +0 -0
  39. package/dist/types/functions/read_utils/imports.d.ts +0 -0
  40. package/dist/types/functions/read_utils/index.d.ts +0 -0
  41. package/dist/types/functions/read_utils/src/index.d.ts +0 -0
  42. package/dist/types/functions/read_utils/src/utils.d.ts +0 -0
  43. package/dist/types/functions/rndm_utils/imports.d.ts +0 -0
  44. package/dist/types/functions/rndm_utils/index.d.ts +0 -0
  45. package/dist/types/functions/rndm_utils/src/index.d.ts +0 -0
  46. package/dist/types/functions/rndm_utils/src/utils.d.ts +0 -1
  47. package/dist/types/functions/safe_utils/imports.d.ts +0 -0
  48. package/dist/types/functions/safe_utils/index.d.ts +0 -0
  49. package/dist/types/functions/safe_utils/src/index.d.ts +0 -0
  50. package/dist/types/functions/safe_utils/src/safe_document.d.ts +0 -0
  51. package/dist/types/functions/safe_utils/src/safe_globals.d.ts +0 -0
  52. package/dist/types/functions/safe_utils/src/safe_storage.d.ts +0 -0
  53. package/dist/types/functions/safe_utils/src/safe_window.d.ts +0 -0
  54. package/dist/types/functions/string_utils/index.d.ts +0 -0
  55. package/dist/types/functions/string_utils/src/index.d.ts +0 -0
  56. package/dist/types/functions/string_utils/src/string_utils.d.ts +0 -2
  57. package/dist/types/functions/type_utils/imports.d.ts +0 -0
  58. package/dist/types/functions/type_utils/index.d.ts +0 -0
  59. package/dist/types/functions/type_utils/src/clean_utils.d.ts +0 -0
  60. package/dist/types/functions/type_utils/src/ensure_utils.d.ts +0 -0
  61. package/dist/types/functions/type_utils/src/imports.d.ts +0 -0
  62. package/dist/types/functions/type_utils/src/index.d.ts +0 -0
  63. package/dist/types/functions/type_utils/src/json_utils.d.ts +0 -0
  64. package/dist/types/functions/type_utils/src/mime_utils.d.ts +0 -0
  65. package/dist/types/functions/type_utils/src/type_utils.d.ts +0 -0
  66. package/dist/types/functions/ui_utils/imports.d.ts +0 -0
  67. package/dist/types/functions/ui_utils/index.d.ts +0 -0
  68. package/dist/types/functions/ui_utils/src/button.d.ts +0 -0
  69. package/dist/types/functions/ui_utils/src/checkbox.d.ts +0 -0
  70. package/dist/types/functions/ui_utils/src/index.d.ts +0 -0
  71. package/dist/types/functions/ui_utils/src/input.d.ts +0 -0
  72. package/dist/types/functions/ui_utils/src/spinner.d.ts +0 -0
  73. package/dist/types/functions/variable_utils/imports.d.ts +0 -0
  74. package/dist/types/functions/variable_utils/index.d.ts +0 -0
  75. package/dist/types/functions/variable_utils/src/index.d.ts +0 -0
  76. package/dist/types/functions/variable_utils/src/variable_utils.d.ts +0 -0
  77. package/dist/types/index.d.ts +0 -0
  78. package/dist/types/types/index.d.ts +0 -0
  79. package/dist/types/types/src/ChangePassword.d.ts +0 -0
  80. package/dist/types/types/src/Files.d.ts +0 -0
  81. package/dist/types/types/src/index.d.ts +0 -0
  82. package/dist/types/types/src/login.d.ts +0 -0
  83. package/dist/types/types/src/logout.d.ts +0 -0
  84. package/dist/types/types/src/utils.d.ts +0 -0
  85. package/dist/types/utils/imports.d.ts +0 -0
  86. package/dist/types/utils/index.d.ts +0 -0
  87. package/dist/types/utils/src/Input.d.ts +0 -0
  88. package/dist/types/utils/src/config.d.ts +0 -0
  89. package/dist/types/utils/src/index.d.ts +0 -0
  90. package/package.json +89 -72
  91. package/dist/functions/auth_utils/imports.js +0 -1
  92. package/dist/functions/auth_utils/index.js +0 -1
  93. package/dist/functions/auth_utils/src/index.js +0 -1
  94. package/dist/functions/auth_utils/src/token_utils.js +0 -104
  95. package/dist/functions/config_utils/imports.js +0 -2
  96. package/dist/functions/config_utils/index.js +0 -1
  97. package/dist/functions/config_utils/src/config_utils.js +0 -16
  98. package/dist/functions/config_utils/src/index.js +0 -1
  99. package/dist/functions/constants_utils/index.js +0 -1
  100. package/dist/functions/constants_utils/src/constants.js +0 -7
  101. package/dist/functions/constants_utils/src/index.js +0 -1
  102. package/dist/functions/env_utils/imports.js +0 -1
  103. package/dist/functions/env_utils/index.js +0 -1
  104. package/dist/functions/env_utils/src/index.js +0 -1
  105. package/dist/functions/env_utils/src/window_utils.js +0 -47
  106. package/dist/functions/fetch_utils/imports.js +0 -2
  107. package/dist/functions/fetch_utils/index.js +0 -1
  108. package/dist/functions/fetch_utils/src/fetch_utils.js +0 -65
  109. package/dist/functions/fetch_utils/src/index.js +0 -3
  110. package/dist/functions/fetch_utils/src/url_utils.js +0 -83
  111. package/dist/functions/fetch_utils/src/utils.js +0 -101
  112. package/dist/functions/index.js +0 -17
  113. package/dist/functions/math_utils/index.js +0 -1
  114. package/dist/functions/math_utils/safe_math.js +0 -26
  115. package/dist/functions/path_utils/imports.js +0 -28
  116. package/dist/functions/path_utils/index.js +0 -1
  117. package/dist/functions/path_utils/src/base_dirs.js +0 -17
  118. package/dist/functions/path_utils/src/function_dirs.js +0 -42
  119. package/dist/functions/path_utils/src/index.js +0 -6
  120. package/dist/functions/path_utils/src/misc_dirs.js +0 -15
  121. package/dist/functions/path_utils/src/path_utils.browser.js +0 -3
  122. package/dist/functions/path_utils/src/path_utils.js +0 -112
  123. package/dist/functions/path_utils/src/path_utils.node.js +0 -3
  124. package/dist/functions/path_utils/src/paths.js +0 -12
  125. package/dist/functions/path_utils/src/src_dirs.js +0 -25
  126. package/dist/functions/read_utils/imports.js +0 -1
  127. package/dist/functions/read_utils/index.js +0 -1
  128. package/dist/functions/read_utils/src/index.js +0 -1
  129. package/dist/functions/read_utils/src/read_utils.browser.js +0 -17
  130. package/dist/functions/read_utils/src/utils.browser.js +0 -32
  131. package/dist/functions/read_utils/src/utils.js +0 -70
  132. package/dist/functions/rndm_utils/imports.js +0 -1
  133. package/dist/functions/rndm_utils/index.js +0 -1
  134. package/dist/functions/rndm_utils/src/index.js +0 -1
  135. package/dist/functions/rndm_utils/src/utils.js +0 -13
  136. package/dist/functions/safe_utils/imports.js +0 -1
  137. package/dist/functions/safe_utils/index.js +0 -1
  138. package/dist/functions/safe_utils/src/index.js +0 -4
  139. package/dist/functions/safe_utils/src/safe_document.js +0 -12
  140. package/dist/functions/safe_utils/src/safe_globals.js +0 -14
  141. package/dist/functions/safe_utils/src/safe_storage.js +0 -52
  142. package/dist/functions/safe_utils/src/safe_window.js +0 -42
  143. package/dist/functions/string_utils/index.js +0 -1
  144. package/dist/functions/string_utils/src/index.js +0 -1
  145. package/dist/functions/string_utils/src/string_utils.js +0 -153
  146. package/dist/functions/type_utils/imports.js +0 -1
  147. package/dist/functions/type_utils/index.js +0 -1
  148. package/dist/functions/type_utils/src/clean_utils.js +0 -38
  149. package/dist/functions/type_utils/src/ensure_utils.js +0 -33
  150. package/dist/functions/type_utils/src/index.js +0 -5
  151. package/dist/functions/type_utils/src/json_utils.js +0 -22
  152. package/dist/functions/type_utils/src/mime_utils.js +0 -311
  153. package/dist/functions/type_utils/src/type_utils.js +0 -39
  154. package/dist/functions/ui_utils/imports.js +0 -5
  155. package/dist/functions/ui_utils/index.js +0 -1
  156. package/dist/functions/ui_utils/src/button.js +0 -22
  157. package/dist/functions/ui_utils/src/checkbox.js +0 -6
  158. package/dist/functions/ui_utils/src/index.js +0 -4
  159. package/dist/functions/ui_utils/src/input.js +0 -6
  160. package/dist/functions/ui_utils/src/spinner.js +0 -4
  161. package/dist/functions/url_utils/index.js +0 -1
  162. package/dist/functions/url_utils/uri_utils.js +0 -69
  163. package/dist/functions/variable_utils/imports.js +0 -1
  164. package/dist/functions/variable_utils/index.js +0 -1
  165. package/dist/functions/variable_utils/src/index.js +0 -1
  166. package/dist/functions/variable_utils/src/variable_utils.js +0 -34
  167. package/dist/functions.json +0 -1727
  168. package/dist/index.js +0 -2
  169. package/dist/types/functions/path_utils/src/path_utils.browser.d.ts +0 -2
  170. package/dist/types/functions/path_utils/src/path_utils.node.d.ts +0 -2
  171. package/dist/types/functions/read_utils/src/read_utils.browser.d.ts +0 -1
  172. package/dist/types/functions/read_utils/src/utils.browser.d.ts +0 -3
  173. package/dist/types/functions/url_utils/index.d.ts +0 -1
  174. package/dist/types/functions/url_utils/uri_utils.d.ts +0 -19
  175. package/dist/types/index.js +0 -1
  176. package/dist/types/src/ChangePassword.js +0 -1
  177. package/dist/types/src/Files.js +0 -1
  178. package/dist/types/src/index.js +0 -5
  179. package/dist/types/src/login.js +0 -1
  180. package/dist/types/src/logout.js +0 -1
  181. package/dist/types/src/utils.js +0 -1
  182. package/dist/utils/imports.js +0 -1
  183. package/dist/utils/index.js +0 -1
  184. package/dist/utils/src/Input.js +0 -2
  185. package/dist/utils/src/config.js +0 -12
  186. package/dist/utils/src/index.js +0 -3
package/dist/index.js DELETED
@@ -1,2 +0,0 @@
1
- export * from './functions';
2
- export * from './types';
@@ -1,2 +0,0 @@
1
- import * as path from 'path-browserify';
2
- export { path };
@@ -1,2 +0,0 @@
1
- import * as path from 'path';
2
- export { path };
@@ -1 +0,0 @@
1
- export declare function readJsonFile<T = any>(url: string): Promise<T | null>;
@@ -1,3 +0,0 @@
1
- export declare function readJsonFile<T = any>(url: string): Promise<T | null>;
2
- export declare function getConfigContent<T = Record<string, any>>(): Promise<T | null>;
3
- export declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
@@ -1 +0,0 @@
1
- export * from './uri_utils';
@@ -1,19 +0,0 @@
1
- /** Encode a single query value/key safely */
2
- export declare const encode: (v: unknown) => string;
3
- /** Decode a single query value/key safely (never throws) */
4
- export declare const decodeSafe: (v: string | null | undefined) => string;
5
- /** Decode strings that might be double-encoded (up to 2 passes) */
6
- export declare const decodeMaybeDouble: (v: string) => string;
7
- /** Convert + to spaces (legacy www-form behavior) then decode */
8
- export declare const decodeFormComponent: (v: string) => string;
9
- /** Build a URL with query params (skips null/undefined) */
10
- export declare const buildUrl: (base: string, params?: Record<string, unknown>) => string;
11
- /** Parse a query string into an object (first value wins; arrays if repeat=true) */
12
- export declare const parseQuery: (qs: string, opts?: {
13
- repeat?: boolean;
14
- form?: boolean;
15
- }) => Record<string, any>;
16
- /** Quick helper: percent-encode whole strings for placement in URLs */
17
- export declare const encodeTextForUrl: (text: string) => string;
18
- /** Quick helper: decode long blobs coming from share-intents/UTMs */
19
- export declare const decodeShareBlob: (blob: string) => string;
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- export * from './Files';
2
- export * from './ChangePassword';
3
- export * from './utils';
4
- export * from './logout';
5
- export * from './login';
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1,2 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const Input = ({ label, type, value, onValueChange, placeholder, disabled, error, directory, multiple, accept, }) => (_jsxs("label", { className: "block", children: [_jsx("span", { className: "text-sm", children: label }), _jsx("input", Object.assign({ type: type, className: `mt-1 w-full border rounded px-2 py-1 ${error ? "border-red-500" : ""}`, value: value, onChange: (e) => onValueChange(e.target.value), placeholder: placeholder, disabled: disabled }, (type === "file" && directory ? { webkitdirectory: "true", directory: "" } : {}), (type === "file" && multiple ? { multiple: true } : {}), (type === "file" && accept ? { accept } : {}))), error && _jsx("p", { className: "text-sm text-red-600", children: error })] }));
@@ -1,12 +0,0 @@
1
- import { __awaiter } from "tslib";
2
- export let AppConfig;
3
- export function loadConfig() {
4
- return __awaiter(this, void 0, void 0, function* () {
5
- const base = (process.env.BASE_API_URL || "").replace(/\/+$/, "");
6
- const url = `${base}/config.json`;
7
- const res = yield fetch(url);
8
- if (!res.ok)
9
- throw new Error(`Failed to load ${url}: ${res.status}`);
10
- AppConfig = yield res.json();
11
- });
12
- }
@@ -1,3 +0,0 @@
1
- //src/utils/src/index.ts
2
- export * from "./Input";
3
- export * from './config';