@putkoff/abstract-utilities 0.1.243 → 0.1.244
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 +511 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +514 -13
- package/dist/esm/index.js.map +1 -1
- package/dist/functions/auth_utils/imports.js +1 -0
- package/dist/functions/auth_utils/index.js +1 -0
- package/dist/functions/auth_utils/src/index.js +1 -0
- package/dist/functions/auth_utils/src/token_utils.js +104 -0
- package/dist/functions/config_utils/imports.js +2 -0
- package/dist/functions/config_utils/index.js +1 -0
- package/dist/functions/config_utils/src/config_utils.js +16 -0
- package/dist/functions/config_utils/src/index.js +1 -0
- package/dist/functions/constants_utils/index.js +1 -0
- package/dist/functions/constants_utils/src/constants.js +7 -0
- package/dist/functions/constants_utils/src/index.js +1 -0
- package/dist/functions/env_utils/imports.js +1 -0
- package/dist/functions/env_utils/index.js +1 -0
- package/dist/functions/env_utils/src/index.js +1 -0
- package/dist/functions/env_utils/src/window_utils.js +47 -0
- package/dist/functions/fetch_utils/imports.js +2 -0
- package/dist/functions/fetch_utils/index.js +1 -0
- package/dist/functions/fetch_utils/src/fetch_utils.js +65 -0
- package/dist/functions/fetch_utils/src/index.js +3 -0
- package/dist/functions/fetch_utils/src/url_utils.js +83 -0
- package/dist/functions/fetch_utils/src/utils.js +101 -0
- package/dist/functions/index.js +17 -0
- package/dist/functions/math_utils/index.js +1 -0
- package/dist/functions/math_utils/safe_math.js +26 -0
- package/dist/functions/path_utils/imports.js +28 -0
- package/dist/functions/path_utils/index.js +1 -0
- package/dist/functions/path_utils/src/base_dirs.js +17 -0
- package/dist/functions/path_utils/src/function_dirs.js +42 -0
- package/dist/functions/path_utils/src/index.js +6 -0
- package/dist/functions/path_utils/src/misc_dirs.js +15 -0
- package/dist/functions/path_utils/src/path_utils.browser.js +3 -0
- package/dist/functions/path_utils/src/path_utils.js +112 -0
- package/dist/functions/path_utils/src/path_utils.node.js +3 -0
- package/dist/functions/path_utils/src/paths.js +12 -0
- package/dist/functions/path_utils/src/src_dirs.js +25 -0
- package/dist/functions/read_utils/imports.js +1 -0
- package/dist/functions/read_utils/index.js +1 -0
- package/dist/functions/read_utils/src/index.js +1 -0
- package/dist/functions/read_utils/src/read_utils.browser.js +17 -0
- package/dist/functions/read_utils/src/utils.browser.js +32 -0
- package/dist/functions/read_utils/src/utils.js +70 -0
- package/dist/functions/rndm_utils/imports.js +1 -0
- package/dist/functions/rndm_utils/index.js +1 -0
- package/dist/functions/rndm_utils/src/index.js +1 -0
- package/dist/functions/rndm_utils/src/utils.js +13 -0
- package/dist/functions/safe_utils/imports.js +1 -0
- package/dist/functions/safe_utils/index.js +1 -0
- package/dist/functions/safe_utils/src/index.js +4 -0
- package/dist/functions/safe_utils/src/safe_document.js +12 -0
- package/dist/functions/safe_utils/src/safe_globals.js +14 -0
- package/dist/functions/safe_utils/src/safe_storage.js +52 -0
- package/dist/functions/safe_utils/src/safe_window.js +42 -0
- package/dist/functions/string_utils/index.js +1 -0
- package/dist/functions/string_utils/src/index.js +1 -0
- package/dist/functions/string_utils/src/string_utils.js +153 -0
- package/dist/functions/type_utils/imports.js +1 -0
- package/dist/functions/type_utils/index.js +1 -0
- package/dist/functions/type_utils/src/clean_utils.js +38 -0
- package/dist/functions/type_utils/src/ensure_utils.js +33 -0
- package/dist/functions/type_utils/src/index.js +5 -0
- package/dist/functions/type_utils/src/json_utils.js +22 -0
- package/dist/functions/type_utils/src/mime_utils.js +311 -0
- package/dist/functions/type_utils/src/type_utils.js +39 -0
- package/dist/functions/ui_utils/imports.js +5 -0
- package/dist/functions/ui_utils/index.js +1 -0
- package/dist/functions/ui_utils/src/button.js +22 -0
- package/dist/functions/ui_utils/src/checkbox.js +6 -0
- package/dist/functions/ui_utils/src/index.js +4 -0
- package/dist/functions/ui_utils/src/input.js +6 -0
- package/dist/functions/ui_utils/src/spinner.js +4 -0
- package/dist/functions/url_utils/index.js +1 -0
- package/dist/functions/url_utils/uri_utils.js +69 -0
- package/dist/functions/variable_utils/imports.js +1 -0
- package/dist/functions/variable_utils/index.js +1 -0
- package/dist/functions/variable_utils/src/index.js +1 -0
- package/dist/functions/variable_utils/src/variable_utils.js +34 -0
- package/dist/functions.json +1727 -0
- package/dist/index.js +2 -0
- package/dist/types/index.js +1 -0
- package/dist/types/src/ChangePassword.js +1 -0
- package/dist/types/src/Files.js +1 -0
- package/dist/types/src/index.js +5 -0
- package/dist/types/src/login.js +1 -0
- package/dist/types/src/logout.js +1 -0
- package/dist/types/src/utils.js +1 -0
- package/dist/utils/imports.js +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/src/Input.js +2 -0
- package/dist/utils/src/config.js +12 -0
- package/dist/utils/src/index.js +3 -0
- package/package.json +4 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1,2 @@
|
|
|
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 })] }));
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putkoff/abstract-utilities",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.244",
|
|
4
4
|
"description": "Reusable abstract utility functions and components for both Node and React.",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -35,6 +35,9 @@
|
|
|
35
35
|
"typescript": "^5.3.3"
|
|
36
36
|
},
|
|
37
37
|
"exports": {
|
|
38
|
+
"./functions": "./dist/functions/index.js",
|
|
39
|
+
"./components": "./dist/components/index.js",
|
|
40
|
+
"./constants": "./dist/constants/index.js",
|
|
38
41
|
".": {
|
|
39
42
|
"import": "./dist/esm/index.js",
|
|
40
43
|
"require": "./dist/cjs/index.js",
|