@putkoff/abstract-utilities 0.1.194 → 0.1.197
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 +113 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +105 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +268 -0
- package/dist/{functions → types/functions}/index.d.ts +1 -0
- package/dist/{functions → types/functions}/path_utils/src/path_utils.d.ts +8 -1
- package/dist/types/functions/type_utils/src/type_utils.d.ts +8 -0
- package/dist/types/functions/variable_utils/imports.d.ts +1 -0
- package/dist/types/functions/variable_utils/src/index.d.ts +1 -0
- package/dist/types/functions/variable_utils/src/variable_utils.d.ts +15 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +4 -3
- package/dist/functions/type_utils/src/type_utils.d.ts +0 -1
- /package/dist/{functions → types/functions}/auth_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/auth_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/auth_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/auth_utils/src/token_utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/config_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/config_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/config_utils/src/config_utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/config_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/constants_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/constants_utils/src/constants.d.ts +0 -0
- /package/dist/{functions → types/functions}/constants_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/env_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/env_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/env_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/env_utils/src/window_utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/fetch_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/fetch_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/fetch_utils/src/fetch_utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/fetch_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/fetch_utils/src/utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/src/base_dirs.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/src/function_dirs.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/src/misc_dirs.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/src/paths.d.ts +0 -0
- /package/dist/{functions → types/functions}/path_utils/src/src_dirs.d.ts +0 -0
- /package/dist/{functions → types/functions}/read_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/read_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/read_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/read_utils/src/utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/rndm_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/rndm_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/rndm_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/rndm_utils/src/utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/src/safe_document.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/src/safe_globals.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/src/safe_storage.d.ts +0 -0
- /package/dist/{functions → types/functions}/safe_utils/src/safe_window.d.ts +0 -0
- /package/dist/{functions → types/functions}/string_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/string_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/string_utils/src/string_utils.d.ts +0 -0
- /package/dist/{functions → types/functions}/type_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/type_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/type_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/imports.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/src/button.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/src/checkbox.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/src/index.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/src/input.d.ts +0 -0
- /package/dist/{functions → types/functions}/ui_utils/src/spinner.d.ts +0 -0
- /package/dist/{utils → types/functions/variable_utils}/index.d.ts +0 -0
- /package/dist/types/{src → types/src}/ChangePassword.d.ts +0 -0
- /package/dist/types/{src → types/src}/Files.d.ts +0 -0
- /package/dist/types/{src → types/src}/index.d.ts +0 -0
- /package/dist/types/{src → types/src}/login.d.ts +0 -0
- /package/dist/types/{src → types/src}/logout.d.ts +0 -0
- /package/dist/types/{src → types/src}/utils.d.ts +0 -0
- /package/dist/{utils → types/utils}/imports.d.ts +0 -0
- /package/dist/{utils → types/utils}/src/Input.d.ts +0 -0
- /package/dist/{utils → types/utils}/src/config.d.ts +0 -0
- /package/dist/{utils → types/utils}/src/index.d.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import React$1 from 'react';
|
|
2
|
+
export { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
|
|
1
5
|
interface FileItem {
|
|
2
6
|
id: number | string;
|
|
3
7
|
filename: string;
|
|
@@ -100,4 +104,268 @@ interface LoginFormProps {
|
|
|
100
104
|
onSubmit: (e: React.FormEvent) => void;
|
|
101
105
|
}
|
|
102
106
|
|
|
107
|
+
declare function getSafeDocument(): Document | undefined;
|
|
108
|
+
declare function getDocumentProp<K1 extends keyof Document>(prop1: K1): Document[K1] | undefined;
|
|
109
|
+
declare function getDocumentProp<K1 extends keyof Document, K2 extends keyof NonNullable<Document[K1]>>(prop1: K1, prop2: K2): NonNullable<Document[K1]>[K2] | undefined;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Returns `window` if running in a browser, otherwise `undefined`.
|
|
113
|
+
*/
|
|
114
|
+
declare function getSafeLocalStorage(): Storage | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Call a Storage method by name, silencing any errors or missing storage.
|
|
117
|
+
*
|
|
118
|
+
* @param method One of the keys of the Storage interface: "getItem", "setItem", etc.
|
|
119
|
+
* @param args The arguments you’d normally pass to that method.
|
|
120
|
+
* @returns The method’s return value, or undefined if storage/method isn’t available.
|
|
121
|
+
*/
|
|
122
|
+
declare function callStorage<K extends keyof Storage>(method: K, ...args: Parameters<Storage[K]>): ReturnType<Storage[K]> | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* Safely call storage methods (`localStorage` or `sessionStorage`) without blowing up.
|
|
125
|
+
* Returns `undefined` on any error.
|
|
126
|
+
*/
|
|
127
|
+
declare function safeStorage<S extends "localStorage" | "sessionStorage", K extends keyof Storage>(storageName: S, method: K, ...args: Parameters<Storage[K]>): ReturnType<Storage[K]> | undefined;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Safely walk `globalThis` (or window/document) by a chain of property names.
|
|
131
|
+
* Returns `undefined` if any step is missing.
|
|
132
|
+
*/
|
|
133
|
+
declare function safeGlobalProp<T = any>(...path: string[]): T | undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Returns the global window object if it exists, otherwise undefined.
|
|
137
|
+
*/
|
|
138
|
+
declare function getSafeWindow(): Window | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Safely call a method on window by name.
|
|
141
|
+
*
|
|
142
|
+
* @param method The Window method to call (e.g. "alert", "open", etc.).
|
|
143
|
+
* @param args Arguments to pass to that method.
|
|
144
|
+
* @returns The method’s return value, or undefined if
|
|
145
|
+
* window/method isn’t available or throws.
|
|
146
|
+
*/
|
|
147
|
+
declare function callWindowMethod<K extends keyof Window, F extends Window[K] = Window[K], Args extends any[] = F extends (...a: infer P) => any ? P : never, R = F extends (...a: any) => infer U ? U : void>(method: K, ...args: Args): R | undefined;
|
|
148
|
+
/** overloads for 1‐ and 2‐level deep props */
|
|
149
|
+
declare function getWindowProp<K1 extends keyof Window>(prop1: K1): Window[K1] | undefined;
|
|
150
|
+
declare function getWindowProp<K1 extends keyof Window, K2 extends keyof NonNullable<Window[K1]>>(prop1: K1, prop2: K2): NonNullable<Window[K1]>[K2] | undefined;
|
|
151
|
+
declare function getWindowHost(): string | undefined;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Helpers for dealing with the JWT stored in localStorage.
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
***Changes**:
|
|
159
|
+
*- Updated import path for `InputProps` to `../../types/interfaces`.
|
|
160
|
+
*
|
|
161
|
+
*3. **Token Utilities** (`src/functions/auth/token_utils.ts`):
|
|
162
|
+
* Copy from `/var/www/abstractendeavors/my-login-app/src/functions/auth_utils/token_utils.ts`.
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
/** Read raw JWT from LocalStorage (or null if absent) */
|
|
166
|
+
declare function getToken(): string | null | any;
|
|
167
|
+
declare function isLoggedIn(): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Add a Bearer Authorization header.
|
|
170
|
+
* A shallow copy of headers is returned so callers can keep chaining.
|
|
171
|
+
*/
|
|
172
|
+
declare function getAuthorizationHeader(headers?: Record<string, string> | null, token?: string | null): Record<string, string>;
|
|
173
|
+
/** Throw + redirect if there’s no valid token; otherwise return it. */
|
|
174
|
+
declare function requireToken(): string;
|
|
175
|
+
/** True if token is structurally bad or its exp ≤ now. */
|
|
176
|
+
declare function isTokenExpired(token: string): boolean;
|
|
177
|
+
/** Convenience wrapper: return username from the JWT (or null). */
|
|
178
|
+
declare function currentUsername(): string | null;
|
|
179
|
+
declare function currentUsernames(): any;
|
|
180
|
+
declare function decodeJwt(token: string): JwtPayload;
|
|
181
|
+
|
|
182
|
+
declare const PROTOCOL = "https://";
|
|
183
|
+
declare const DOMAIN_NAME = "abstractendeavors";
|
|
184
|
+
declare const BASE_URL = "https://abstractendeavors.com";
|
|
185
|
+
declare const SUB_DIR = "secure-files";
|
|
186
|
+
declare const PROD_PREFIX = "/secure-files/";
|
|
187
|
+
declare const API_PREFIX = "/secure-files/api";
|
|
188
|
+
declare const DEV_PREFIX = "/secure-files-dev/";
|
|
189
|
+
|
|
190
|
+
declare function get_window(): (Window & typeof globalThis) | null;
|
|
191
|
+
declare function get_window_location(): Location | "https://abstractendeavors.com" | null;
|
|
192
|
+
declare function get_window_pathname(): string | null;
|
|
193
|
+
declare function get_window_parts(): Location | "https://abstractendeavors.com" | null;
|
|
194
|
+
|
|
195
|
+
declare function fetchIt<T>(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<T>;
|
|
196
|
+
declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<Blob>;
|
|
197
|
+
declare function getHtmlDirectory(directory: string, filename: string): string;
|
|
198
|
+
declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
|
|
199
|
+
declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Reads a JSON file, either via Node’s fs (if available)
|
|
203
|
+
* or via window.fetch in the browser. Never throws — returns
|
|
204
|
+
* the parsed object or null on any error.
|
|
205
|
+
*/
|
|
206
|
+
declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T | null>;
|
|
207
|
+
declare function getConfigContent<T = Record<string, any>>(): Promise<T | null>;
|
|
208
|
+
declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
212
|
+
*/
|
|
213
|
+
declare function getResult<T>(obj: unknown): T;
|
|
214
|
+
declare function getMethod(method?: string | null, body?: unknown): string;
|
|
215
|
+
declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
216
|
+
declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
217
|
+
declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
|
|
218
|
+
declare function parseResult(res: Response): Promise<unknown>;
|
|
219
|
+
/**
|
|
220
|
+
* Intercept 401/403 and force a clean redirect to login
|
|
221
|
+
* without ever showing an alert.
|
|
222
|
+
*/
|
|
223
|
+
declare function checkResponse(res: Response): Response;
|
|
224
|
+
|
|
225
|
+
declare function get_dirname(filePath: string | null): string;
|
|
226
|
+
declare function get_basename(filePath: string | null): string;
|
|
227
|
+
declare function get_filename(file_path: string): string;
|
|
228
|
+
declare function get_extname(filePath: string | null): string;
|
|
229
|
+
declare function get_splitext(filePath: string | null): {
|
|
230
|
+
filename: string;
|
|
231
|
+
extname: string;
|
|
232
|
+
ext?: undefined;
|
|
233
|
+
} | {
|
|
234
|
+
filename: string;
|
|
235
|
+
ext: string;
|
|
236
|
+
extname?: undefined;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Join multiple path segments, normalizing leading/trailing slashes.
|
|
240
|
+
*
|
|
241
|
+
* Usage:
|
|
242
|
+
* make_path('/foo','bar','baz')
|
|
243
|
+
* make_path(['/foo','bar','baz'])
|
|
244
|
+
*/
|
|
245
|
+
declare function make_path(...paths: Array<string | string[]>): string;
|
|
246
|
+
declare function sanitizeFilename(filename: string): string;
|
|
247
|
+
declare function make_sanitized_path(...paths: string[]): string;
|
|
248
|
+
declare function normalizeUrl(base: string, p?: string): string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Returns the absolute path of the current file.
|
|
252
|
+
*/
|
|
253
|
+
declare function getAbsDir(): string;
|
|
254
|
+
declare function getAbsPath(subPath: string): string;
|
|
255
|
+
|
|
256
|
+
declare function getFunctionsDir(): string;
|
|
257
|
+
declare function geAuthsUtilsDirectory(): string;
|
|
258
|
+
declare function geBackupsUtilsDirectory(): string;
|
|
259
|
+
declare function geConstantsUtilsDirectory(): string;
|
|
260
|
+
declare function geEnvUtilsDirectory(): string;
|
|
261
|
+
declare function geFetchUtilsDirectory(): string;
|
|
262
|
+
declare function geFileUtilsDirectory(): string;
|
|
263
|
+
declare function gePathUtilsDirectory(): string;
|
|
264
|
+
declare function geStringUtilsDirectory(): string;
|
|
265
|
+
declare function geTypeUtilsDirectory(): string;
|
|
266
|
+
|
|
267
|
+
declare function getSrcDir(): string;
|
|
268
|
+
declare function geStaticDirectory(): string;
|
|
269
|
+
declare function getLibUtilsDirectory(): string;
|
|
270
|
+
declare function getHooksUtilsDirectory(): string;
|
|
271
|
+
declare function getFunctionsUtilsDirectory(): string;
|
|
272
|
+
declare function getComponentsUtilsDirectory(): string;
|
|
273
|
+
|
|
274
|
+
declare function getBaseDir(): string;
|
|
275
|
+
declare function getPublicDir(): string;
|
|
276
|
+
declare function getDistDir(): string;
|
|
277
|
+
declare function getEnvDir(): string;
|
|
278
|
+
|
|
279
|
+
declare function getEnvPath(string?: string): string;
|
|
280
|
+
declare function getDbConfigsPath(): string;
|
|
281
|
+
declare function getSchemasPath(): string;
|
|
282
|
+
declare function getSchemasDirPath(subPath: string): string;
|
|
283
|
+
|
|
284
|
+
declare function alertit(obj?: any): void;
|
|
285
|
+
|
|
286
|
+
declare function getSubstring(obj: string, maxLength?: number | null, minLength?: number | null): string;
|
|
287
|
+
declare function truncateString(obj: string, maxLength?: number): string;
|
|
288
|
+
declare function stripPrefixes(str: string, bases?: string | string[]): string;
|
|
289
|
+
/**
|
|
290
|
+
* Removes characters from the beginning of the string
|
|
291
|
+
* if they are found in the list of characters.
|
|
292
|
+
*
|
|
293
|
+
* @param str - The input string.
|
|
294
|
+
* @param listObjects - A string or an array of characters to remove.
|
|
295
|
+
* @returns The modified string.
|
|
296
|
+
*/
|
|
297
|
+
declare function eatInner(str: string, listObjects: string | string[]): string;
|
|
298
|
+
/**
|
|
299
|
+
* Removes characters from the end of the string
|
|
300
|
+
* if they are found in the list of characters.
|
|
301
|
+
*
|
|
302
|
+
* @param str - The input string.
|
|
303
|
+
* @param listObjects - A string or an array of characters to remove.
|
|
304
|
+
* @returns The modified string.
|
|
305
|
+
*/
|
|
306
|
+
declare function eatOuter(str: string, listObjects: string | string[]): string;
|
|
307
|
+
/**
|
|
308
|
+
* Removes characters from both the beginning and the end of the string
|
|
309
|
+
* if they are found in the list of characters.
|
|
310
|
+
*
|
|
311
|
+
* @param str - The input string.
|
|
312
|
+
* @param listObjects - A string or an array of characters to remove.
|
|
313
|
+
* @returns The modified string.
|
|
314
|
+
*/
|
|
315
|
+
declare function eatAll(str: string, listObjects: string | string[]): string;
|
|
316
|
+
declare function eatEnd(obj: string, endings?: string[]): string;
|
|
317
|
+
declare function tryParse(obj: any): any;
|
|
318
|
+
declare function create_list_string(array_obj: any): string;
|
|
319
|
+
|
|
320
|
+
declare function ensure_list<T>(obj: T | T[]): T[];
|
|
321
|
+
declare function assureString(obj: any): string;
|
|
322
|
+
declare function cleanArray(obj: any): unknown[];
|
|
323
|
+
declare function assureArray(input: string | string[]): any;
|
|
324
|
+
declare function get_key_value<T extends object>(obj: T, key: string): any;
|
|
325
|
+
declare function get<T extends object>(obj: T | null | undefined, keys: string | string[], defaultValue?: any): any;
|
|
326
|
+
declare function cleanText(input: any): any;
|
|
327
|
+
declare function getCleanArray(obj: any): unknown[];
|
|
328
|
+
|
|
329
|
+
declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
330
|
+
color?: 'gray' | 'green' | 'blue';
|
|
331
|
+
variant?: 'default' | 'icon' | 'primary' | 'secondary';
|
|
332
|
+
className?: string;
|
|
333
|
+
}): react_jsx_runtime.JSX.Element;
|
|
334
|
+
|
|
335
|
+
declare function Checkbox({ label, ...rest }: React$1.InputHTMLAttributes<HTMLInputElement> & {
|
|
336
|
+
label: string;
|
|
337
|
+
}): react_jsx_runtime.JSX.Element;
|
|
338
|
+
|
|
339
|
+
declare function Input({ label, trailing, ...rest }: React$1.InputHTMLAttributes<HTMLInputElement> & {
|
|
340
|
+
label: string;
|
|
341
|
+
trailing?: React$1.ReactNode;
|
|
342
|
+
}): react_jsx_runtime.JSX.Element;
|
|
343
|
+
|
|
344
|
+
declare function Spinner(): react_jsx_runtime.JSX.Element;
|
|
345
|
+
|
|
346
|
+
declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
|
|
347
|
+
/**
|
|
348
|
+
* getConfig(): Promise<AppConfig>
|
|
349
|
+
* getConfig(key): Promise<AppConfig[K]>
|
|
350
|
+
*/
|
|
351
|
+
declare function getConfig(): Promise<AppConfig>;
|
|
352
|
+
declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Processes keywords by checking if keywords is a string and splitting it.
|
|
356
|
+
* Then cleans each keyword using `eatAll` with a set of characters to remove.
|
|
357
|
+
*
|
|
358
|
+
* @param keywords - The keywords as a comma-separated string or as an array.
|
|
359
|
+
* @returns An array of cleaned keywords.
|
|
360
|
+
*/
|
|
361
|
+
declare function processKeywords(keywords: string | string[]): string[];
|
|
362
|
+
/**
|
|
363
|
+
* Constructs a keyword string where each keyword is prefixed with a hash (#).
|
|
364
|
+
*
|
|
365
|
+
* @param keywords - An array of keywords.
|
|
366
|
+
* @returns A string with each keyword prefixed by '#'.
|
|
367
|
+
*/
|
|
368
|
+
declare function get_keyword_string(keywords: any): string;
|
|
369
|
+
|
|
370
|
+
export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertit, assureArray, assureString, callStorage, callWindowMethod, checkResponse, cleanArray, cleanText, create_list_string, currentUsername, currentUsernames, decodeJwt, eatAll, eatEnd, eatInner, eatOuter, ensure_list, fetchIndexHtml, fetchIndexHtmlContainer, fetchIt, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, get, getAbsDir, getAbsPath, getAuthorizationHeader, getBaseDir, getBody, getCleanArray, getComponentsUtilsDirectory, getConfig, getConfigContent, getConfigVar, getDbConfigsPath, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMethod, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, getWindowHost, getWindowProp, get_basename, get_dirname, get_extname, get_filename, get_key_value, get_keyword_string, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isTokenExpired, loadConfig, make_path, make_sanitized_path, normalizeUrl, parseResult, processKeywords, readJsonFile, requireToken, safeGlobalProp, safeStorage, sanitizeFilename, stripPrefixes, truncateString, tryParse };
|
|
103
371
|
export type { ApiRow, AppConfig, ChangePasswordFormProps, ChangePasswordProps, FetchVariables, FileItem, FileListResponse, InputProps, JwtPayload, LoginFormProps, LoginProps, LogoutButtonProps, Promise$1 as Promise, UrlKey };
|
|
@@ -11,7 +11,14 @@ export declare function get_splitext(filePath: string | null): {
|
|
|
11
11
|
ext: string;
|
|
12
12
|
extname?: undefined;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Join multiple path segments, normalizing leading/trailing slashes.
|
|
16
|
+
*
|
|
17
|
+
* Usage:
|
|
18
|
+
* make_path('/foo','bar','baz')
|
|
19
|
+
* make_path(['/foo','bar','baz'])
|
|
20
|
+
*/
|
|
21
|
+
export declare function make_path(...paths: Array<string | string[]>): string;
|
|
15
22
|
export declare function sanitizeFilename(filename: string): string;
|
|
16
23
|
export declare function make_sanitized_path(...paths: string[]): string;
|
|
17
24
|
export declare function normalizeUrl(base: string, p?: string): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function ensure_list<T>(obj: T | T[]): T[];
|
|
2
|
+
export declare function assureString(obj: any): string;
|
|
3
|
+
export declare function cleanArray(obj: any): unknown[];
|
|
4
|
+
export declare function assureArray(input: string | string[]): any;
|
|
5
|
+
export declare function get_key_value<T extends object>(obj: T, key: string): any;
|
|
6
|
+
export declare function get<T extends object>(obj: T | null | undefined, keys: string | string[], defaultValue?: any): any;
|
|
7
|
+
export declare function cleanText(input: any): any;
|
|
8
|
+
export declare function getCleanArray(obj: any): unknown[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { eatAll } from './../string_utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './variable_utils';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes keywords by checking if keywords is a string and splitting it.
|
|
3
|
+
* Then cleans each keyword using `eatAll` with a set of characters to remove.
|
|
4
|
+
*
|
|
5
|
+
* @param keywords - The keywords as a comma-separated string or as an array.
|
|
6
|
+
* @returns An array of cleaned keywords.
|
|
7
|
+
*/
|
|
8
|
+
export declare function processKeywords(keywords: string | string[]): string[];
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a keyword string where each keyword is prefixed with a hash (#).
|
|
11
|
+
*
|
|
12
|
+
* @param keywords - An array of keywords.
|
|
13
|
+
* @returns A string with each keyword prefixed by '#'.
|
|
14
|
+
*/
|
|
15
|
+
export declare function get_keyword_string(keywords: any): string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './functions';
|
|
2
|
+
export * from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putkoff/abstract-utilities",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.197",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A reusable React Login component with JWT authentication",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "tsc --emitDeclarationOnly && rollup -c",
|
|
11
11
|
"test": "jest",
|
|
12
|
-
"prepublishOnly": "npm run build"
|
|
12
|
+
"prepublishOnly": "npm run build",
|
|
13
|
+
"release": "npm version patch -m \"chore(release): v%s\" && npm run build && npm publish --access public"
|
|
13
14
|
},
|
|
14
15
|
"keywords": [
|
|
15
16
|
"react",
|
|
@@ -88,4 +89,4 @@
|
|
|
88
89
|
"ts-node": {
|
|
89
90
|
"esm": true
|
|
90
91
|
}
|
|
91
|
-
}
|
|
92
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function ensure_list<T>(obj: T | T[]): T[];
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|