@putkoff/abstract-utilities 0.1.243 → 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.
- package/dist/cjs/index.js +771 -355
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +773 -341
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +14 -40
- package/dist/types/functions/auth_utils/imports.d.ts +0 -0
- package/dist/types/functions/auth_utils/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/token_utils.d.ts +0 -1
- package/dist/types/functions/config_utils/imports.d.ts +0 -0
- package/dist/types/functions/config_utils/index.d.ts +0 -0
- package/dist/types/functions/config_utils/src/config_utils.d.ts +6 -2
- package/dist/types/functions/config_utils/src/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/constants.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/imports.d.ts +0 -0
- package/dist/types/functions/env_utils/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/window_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/imports.d.ts +0 -0
- package/dist/types/functions/fetch_utils/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/fetch_utils.d.ts +2 -2
- package/dist/types/functions/fetch_utils/src/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/url_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/utils.d.ts +1 -2
- package/dist/types/functions/index.d.ts +1 -2
- package/dist/types/functions/math_utils/index.d.ts +0 -0
- package/dist/types/functions/math_utils/safe_math.d.ts +0 -0
- package/dist/types/functions/path_utils/imports.d.ts +0 -0
- package/dist/types/functions/path_utils/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/base_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/function_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/misc_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/path_utils.d.ts +0 -4
- package/dist/types/functions/path_utils/src/paths.d.ts +0 -0
- package/dist/types/functions/path_utils/src/src_dirs.d.ts +0 -0
- package/dist/types/functions/read_utils/imports.d.ts +0 -0
- package/dist/types/functions/read_utils/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/rndm_utils/imports.d.ts +0 -0
- package/dist/types/functions/rndm_utils/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/utils.d.ts +0 -1
- package/dist/types/functions/safe_utils/imports.d.ts +0 -0
- package/dist/types/functions/safe_utils/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_document.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_globals.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_storage.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_window.d.ts +0 -0
- package/dist/types/functions/string_utils/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/string_utils.d.ts +0 -2
- package/dist/types/functions/type_utils/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/clean_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/ensure_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/src/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/json_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/mime_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/type_utils.d.ts +0 -0
- package/dist/types/functions/ui_utils/imports.d.ts +0 -0
- package/dist/types/functions/ui_utils/index.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/button.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/checkbox.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/index.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/input.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/spinner.d.ts +0 -0
- package/dist/types/functions/variable_utils/imports.d.ts +0 -0
- package/dist/types/functions/variable_utils/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/variable_utils.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/types/index.d.ts +0 -0
- package/dist/types/types/src/ChangePassword.d.ts +0 -0
- package/dist/types/types/src/Files.d.ts +0 -0
- package/dist/types/types/src/index.d.ts +0 -0
- package/dist/types/types/src/login.d.ts +0 -0
- package/dist/types/types/src/logout.d.ts +0 -0
- package/dist/types/types/src/utils.d.ts +0 -0
- package/dist/types/utils/imports.d.ts +0 -0
- package/dist/types/utils/index.d.ts +0 -0
- package/dist/types/utils/src/Input.d.ts +0 -0
- package/dist/types/utils/src/config.d.ts +0 -0
- package/dist/types/utils/src/index.d.ts +0 -0
- package/package.json +89 -69
- package/dist/types/functions/path_utils/src/path_utils.browser.d.ts +0 -2
- package/dist/types/functions/path_utils/src/path_utils.node.d.ts +0 -2
- package/dist/types/functions/read_utils/src/read_utils.browser.d.ts +0 -1
- package/dist/types/functions/read_utils/src/utils.browser.d.ts +0 -3
- package/dist/types/functions/url_utils/index.d.ts +0 -1
- package/dist/types/functions/url_utils/uri_utils.d.ts +0 -19
package/dist/index.d.ts
CHANGED
|
@@ -165,7 +165,6 @@ declare function getWindowHost(): string | undefined;
|
|
|
165
165
|
/** Read raw JWT from LocalStorage (or null if absent) */
|
|
166
166
|
declare function getToken(): string | null | any;
|
|
167
167
|
declare function isLoggedIn(): boolean;
|
|
168
|
-
declare function removeToken(): boolean;
|
|
169
168
|
/**
|
|
170
169
|
* Add a Bearer Authorization header.
|
|
171
170
|
* A shallow copy of headers is returned so callers can keep chaining.
|
|
@@ -193,8 +192,8 @@ declare function get_window_location(): Location | "https://abstractendeavors.co
|
|
|
193
192
|
declare function get_window_pathname(): string | null;
|
|
194
193
|
declare function get_window_parts(): Location | "https://abstractendeavors.com" | null;
|
|
195
194
|
|
|
196
|
-
declare function fetchIt<T>(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean,
|
|
197
|
-
declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean,
|
|
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>;
|
|
198
197
|
declare function getHtmlDirectory(directory: string, filename: string): string;
|
|
199
198
|
declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
|
|
200
199
|
declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
|
|
@@ -211,8 +210,7 @@ declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
|
|
|
211
210
|
/**
|
|
212
211
|
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
213
212
|
*/
|
|
214
|
-
declare function getResult<T>(obj:
|
|
215
|
-
declare const get_result: typeof getResult;
|
|
213
|
+
declare function getResult<T>(obj: unknown): T;
|
|
216
214
|
declare function getMethod(method?: string | null, body?: unknown): string;
|
|
217
215
|
declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
218
216
|
declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
@@ -269,12 +267,8 @@ declare function get_splitext(filePath: string | null): {
|
|
|
269
267
|
* make_path(['/foo','bar','baz'])
|
|
270
268
|
*/
|
|
271
269
|
declare function make_path(...paths: Array<string | string[]>): string;
|
|
272
|
-
declare function makePath(...paths: any[]): string;
|
|
273
270
|
declare function sanitizeFilename(filename: string): string;
|
|
274
|
-
declare function get_relative_path(directory: string, fullPath: string): string;
|
|
275
|
-
declare function get_safe_path(p: string): string;
|
|
276
271
|
declare function make_sanitized_path(...paths: string[]): string;
|
|
277
|
-
/** FIXED: your regexes were strings. This correctly joins without duplicate slashes. */
|
|
278
272
|
declare function normalizeUrl(base: string, p?: string): string;
|
|
279
273
|
|
|
280
274
|
/**
|
|
@@ -312,12 +306,9 @@ declare function getSchemasPath(): string;
|
|
|
312
306
|
declare function getSchemasDirPath(subPath: string): string;
|
|
313
307
|
|
|
314
308
|
declare function alertit(obj?: any): void;
|
|
315
|
-
declare const alertIt: typeof alertit;
|
|
316
309
|
|
|
317
310
|
declare function getSubstring(obj: string, maxLength?: number | null, minLength?: number | null): string;
|
|
318
311
|
declare function truncateString(obj: string, maxLength?: number): string;
|
|
319
|
-
declare function capitalize_str(string: any): string;
|
|
320
|
-
declare function capitalize(string: any): string;
|
|
321
312
|
declare function stripPrefixes(str: string, bases?: string | string[]): string;
|
|
322
313
|
/**
|
|
323
314
|
* Removes characters from the beginning of the string
|
|
@@ -350,6 +341,11 @@ declare function eatEnd(obj: string, endings?: string[]): string;
|
|
|
350
341
|
declare function tryParse(obj: any): any;
|
|
351
342
|
declare function create_list_string(array_obj: any): string;
|
|
352
343
|
|
|
344
|
+
declare function safeNums(...args: Array<number | string | null | undefined>): number[];
|
|
345
|
+
declare function safeDivide(...args: Array<number | string | null | undefined>): number;
|
|
346
|
+
declare function safeMultiply(...args: Array<number | string | null | undefined>): number;
|
|
347
|
+
declare function roundPercentage(x: any): number;
|
|
348
|
+
|
|
353
349
|
declare function cleanText(input: any): any;
|
|
354
350
|
declare function cleanArray(obj: any): unknown[];
|
|
355
351
|
declare function getCleanArray(obj: any): unknown[];
|
|
@@ -581,10 +577,13 @@ declare function Input({ label, trailing, ...rest }: React$1.InputHTMLAttributes
|
|
|
581
577
|
|
|
582
578
|
declare function Spinner(): react_jsx_runtime.JSX.Element;
|
|
583
579
|
|
|
580
|
+
declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
|
|
584
581
|
/**
|
|
585
|
-
*
|
|
582
|
+
* getConfig(): Promise<AppConfig>
|
|
583
|
+
* getConfig(key): Promise<AppConfig[K]>
|
|
586
584
|
*/
|
|
587
|
-
declare function
|
|
585
|
+
declare function getConfig(): Promise<AppConfig>;
|
|
586
|
+
declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
|
|
588
587
|
|
|
589
588
|
/**
|
|
590
589
|
* Processes keywords by checking if keywords is a string and splitting it.
|
|
@@ -602,30 +601,5 @@ declare function processKeywords(keywords: string | string[]): string[];
|
|
|
602
601
|
*/
|
|
603
602
|
declare function get_keyword_string(keywords: any): string;
|
|
604
603
|
|
|
605
|
-
|
|
606
|
-
declare function safeDivide(...args: Array<number | string | null | undefined>): number;
|
|
607
|
-
declare function safeMultiply(...args: Array<number | string | null | undefined>): number;
|
|
608
|
-
declare function roundPercentage(x: any): number;
|
|
609
|
-
|
|
610
|
-
/** Encode a single query value/key safely */
|
|
611
|
-
declare const encode: (v: unknown) => string;
|
|
612
|
-
/** Decode a single query value/key safely (never throws) */
|
|
613
|
-
declare const decodeSafe: (v: string | null | undefined) => string;
|
|
614
|
-
/** Decode strings that might be double-encoded (up to 2 passes) */
|
|
615
|
-
declare const decodeMaybeDouble: (v: string) => string;
|
|
616
|
-
/** Convert + to spaces (legacy www-form behavior) then decode */
|
|
617
|
-
declare const decodeFormComponent: (v: string) => string;
|
|
618
|
-
/** Build a URL with query params (skips null/undefined) */
|
|
619
|
-
declare const buildUrl: (base: string, params?: Record<string, unknown>) => string;
|
|
620
|
-
/** Parse a query string into an object (first value wins; arrays if repeat=true) */
|
|
621
|
-
declare const parseQuery: (qs: string, opts?: {
|
|
622
|
-
repeat?: boolean;
|
|
623
|
-
form?: boolean;
|
|
624
|
-
}) => Record<string, any>;
|
|
625
|
-
/** Quick helper: percent-encode whole strings for placement in URLs */
|
|
626
|
-
declare const encodeTextForUrl: (text: string) => string;
|
|
627
|
-
/** Quick helper: decode long blobs coming from share-intents/UTMs */
|
|
628
|
-
declare const decodeShareBlob: (blob: string) => string;
|
|
629
|
-
|
|
630
|
-
export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, MEDIA_TYPES, MIME_TYPES, 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, confirmType, confirm_type, 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, getAllFileTypes, getAllFileTypesSync, getAlphaNum, getAlphas, getAuthorizationHeader, getBaseDir, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfigContent, getConfigJson, getConfigVar, getDbConfigsPath, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMediaExts, getMediaMap, getMethod, getMimeType, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, getWindowHost, getWindowProp, get_all_file_types, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_media_exts, get_media_map, get_mime_type, get_relative_path, get_result, get_safe_path, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isMediaType, isNum, isStrInString, isTokenExpired, isType, is_media_type, 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 };
|
|
604
|
+
export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, MEDIA_TYPES, MIME_TYPES, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertit, assureArray, assureList, assureNumber, assureString, assure_array, assure_list, assure_number, assure_string, callStorage, callWindowMethod, checkResponse, cleanArray, cleanText, confirmType, confirm_type, create_list_string, currentUsername, currentUsernames, decodeJwt, eatAll, eatEnd, eatInner, eatOuter, 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, getAllFileTypes, getAllFileTypesSync, getAlphaNum, getAlphas, getAuthorizationHeader, getBaseDir, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfig, getConfigContent, getConfigVar, getDbConfigsPath, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMediaExts, getMediaMap, getMethod, getMimeType, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, getWindowHost, getWindowProp, get_all_file_types, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_media_exts, get_media_map, get_mime_type, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isMediaType, isNum, isStrInString, isTokenExpired, isType, is_media_type, loadConfig, make_path, make_sanitized_path, normalizeUrl, parseResult, path_to_url, processKeywords, readJsonFile, requireToken, roundPercentage, safeDivide, safeGlobalProp, safeMultiply, safeNums, safeStorage, sanitizeFilename, stripPrefixes, truncateString, tryParse, urlJoin, url_to_path };
|
|
631
605
|
export type { ApiRow, AppConfig, ChangePasswordFormProps, ChangePasswordProps, FetchVariables, FileItem, FileListResponse, InputProps, JwtPayload, LoginFormProps, LoginProps, LogoutButtonProps, MediaCategory, MediaMap, MediaOptions, MimeByExt, Promise$1 as Promise, UrlKey };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -13,7 +13,6 @@ import type { JwtPayload } from './../imports';
|
|
|
13
13
|
/** Read raw JWT from LocalStorage (or null if absent) */
|
|
14
14
|
export declare function getToken(): string | null | any;
|
|
15
15
|
export declare function isLoggedIn(): boolean;
|
|
16
|
-
export declare function removeToken(): boolean;
|
|
17
16
|
/**
|
|
18
17
|
* Add a Bearer Authorization header.
|
|
19
18
|
* A shallow copy of headers is returned so callers can keep chaining.
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import type { AppConfig } from "./../imports";
|
|
2
|
+
export declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
4
|
+
* getConfig(): Promise<AppConfig>
|
|
5
|
+
* getConfig(key): Promise<AppConfig[K]>
|
|
3
6
|
*/
|
|
4
|
-
export declare function
|
|
7
|
+
export declare function getConfig(): Promise<AppConfig>;
|
|
8
|
+
export declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
|
|
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function fetchIt<T>(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean,
|
|
2
|
-
export declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean,
|
|
1
|
+
export 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>;
|
|
2
|
+
export 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>;
|
|
3
3
|
export declare function getHtmlDirectory(directory: string, filename: string): string;
|
|
4
4
|
export declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
|
|
5
5
|
export declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
|
|
File without changes
|
|
File without changes
|
|
@@ -2,8 +2,7 @@ import { FetchVariables } from './../imports';
|
|
|
2
2
|
/**
|
|
3
3
|
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
4
4
|
*/
|
|
5
|
-
export declare function getResult<T>(obj:
|
|
6
|
-
export declare const get_result: typeof getResult;
|
|
5
|
+
export declare function getResult<T>(obj: unknown): T;
|
|
7
6
|
export declare function getMethod(method?: string | null, body?: unknown): string;
|
|
8
7
|
export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
9
8
|
export declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
@@ -6,6 +6,7 @@ export * from './fetch_utils';
|
|
|
6
6
|
export * from './path_utils';
|
|
7
7
|
export * from './rndm_utils';
|
|
8
8
|
export * from './string_utils';
|
|
9
|
+
export * from './math_utils';
|
|
9
10
|
export * from './type_utils';
|
|
10
11
|
export * from './ui_utils';
|
|
11
12
|
export * from './config_utils';
|
|
@@ -13,5 +14,3 @@ export * from './read_utils';
|
|
|
13
14
|
export * from './safe_utils';
|
|
14
15
|
export * from './read_utils';
|
|
15
16
|
export * from './variable_utils';
|
|
16
|
-
export * from './math_utils';
|
|
17
|
-
export * from './url_utils';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -19,10 +19,6 @@ export declare function get_splitext(filePath: string | null): {
|
|
|
19
19
|
* make_path(['/foo','bar','baz'])
|
|
20
20
|
*/
|
|
21
21
|
export declare function make_path(...paths: Array<string | string[]>): string;
|
|
22
|
-
export declare function makePath(...paths: any[]): string;
|
|
23
22
|
export declare function sanitizeFilename(filename: string): string;
|
|
24
|
-
export declare function get_relative_path(directory: string, fullPath: string): string;
|
|
25
|
-
export declare function get_safe_path(p: string): string;
|
|
26
23
|
export declare function make_sanitized_path(...paths: string[]): string;
|
|
27
|
-
/** FIXED: your regexes were strings. This correctly joins without duplicate slashes. */
|
|
28
24
|
export declare function normalizeUrl(base: string, p?: string): string;
|
|
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
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export declare function getSubstring(obj: string, maxLength?: number | null, minLength?: number | null): string;
|
|
2
2
|
export declare function truncateString(obj: string, maxLength?: number): string;
|
|
3
|
-
export declare function capitalize_str(string: any): string;
|
|
4
|
-
export declare function capitalize(string: any): string;
|
|
5
3
|
export declare function stripPrefixes(str: string, bases?: string | string[]): string;
|
|
6
4
|
/**
|
|
7
5
|
* Removes characters from the beginning of the string
|
|
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
|
package/dist/types/index.d.ts
CHANGED
|
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
|
package/package.json
CHANGED
|
@@ -1,72 +1,92 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
2
|
+
"name": "@putkoff/abstract-utilities",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A reusable React Login component with JWT authentication",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc --emitDeclarationOnly && rollup -c",
|
|
11
|
+
"test": "jest",
|
|
12
|
+
"prepublishOnly": "npm run build",
|
|
13
|
+
"release": "npm version patch -m \"chore(release): v%s\" && npm run build && npm publish --access public"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"react",
|
|
17
|
+
"login",
|
|
18
|
+
"component",
|
|
19
|
+
"jwt",
|
|
20
|
+
"authentication"
|
|
21
|
+
],
|
|
22
|
+
"author": "Your Name",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
26
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"path-browserify": "^1.0.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
33
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
34
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
35
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
36
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
37
|
+
"@testing-library/react": "^14.2.1",
|
|
38
|
+
"@types/jest": "^29.5.12",
|
|
39
|
+
"@types/node": "^24.0.13",
|
|
40
|
+
"@types/react": "^18.3.23",
|
|
41
|
+
"@types/react-dom": "^18.3.7",
|
|
42
|
+
"jest": "^29.7.0",
|
|
43
|
+
"postcss": "^8.5.6",
|
|
44
|
+
"rollup": "^4.12.0",
|
|
45
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
46
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
47
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
48
|
+
"ts-jest": "^29.1.2",
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"tslib": "^2.8.1",
|
|
51
|
+
"tsx": "^4.20.3",
|
|
52
|
+
"typescript": "^5.3.3"
|
|
53
|
+
},
|
|
54
|
+
"compilerOptions": {
|
|
55
|
+
"target": "es2016",
|
|
56
|
+
"module": "esnext",
|
|
57
|
+
"esModuleInterop": true,
|
|
58
|
+
"forceConsistentCasingInFileNames": true,
|
|
59
|
+
"strict": true,
|
|
60
|
+
"skipLibCheck": true,
|
|
61
|
+
"jsx": "react-jsx",
|
|
62
|
+
"declaration": true,
|
|
63
|
+
"declarationDir": "dist",
|
|
64
|
+
"outDir": "dist",
|
|
65
|
+
"moduleResolution": "node",
|
|
66
|
+
"allowSyntheticDefaultImports": true,
|
|
67
|
+
"types": "dist/types/index.d.ts",
|
|
68
|
+
"allowImportingTsExtensions": true
|
|
69
|
+
},
|
|
70
|
+
"include": [
|
|
71
|
+
"src/**/*"
|
|
72
|
+
],
|
|
73
|
+
"exclude": [
|
|
74
|
+
"node_modules",
|
|
75
|
+
"dist"
|
|
76
|
+
],
|
|
77
|
+
"exports": {
|
|
78
|
+
".": {
|
|
79
|
+
"import": "./dist/esm/index.js",
|
|
80
|
+
"require": "./dist/cjs/index.js"
|
|
81
|
+
},
|
|
82
|
+
"./package.json": "./package.json"
|
|
83
|
+
},
|
|
84
|
+
"files": [
|
|
85
|
+
"dist/",
|
|
86
|
+
"src/components/Login/login_style.css",
|
|
87
|
+
"src/components/ChangePassword/change_password.css"
|
|
88
|
+
],
|
|
89
|
+
"ts-node": {
|
|
90
|
+
"esm": true
|
|
42
91
|
}
|
|
43
|
-
},
|
|
44
|
-
"files": [
|
|
45
|
-
"dist/"
|
|
46
|
-
],
|
|
47
|
-
"scripts": {
|
|
48
|
-
"build": "tsc --emitDeclarationOnly && rollup -c",
|
|
49
|
-
"test": "jest",
|
|
50
|
-
"release": "npm version patch -m \"chore(release): v%s\" && npm run build && npm publish --access public"
|
|
51
|
-
},
|
|
52
|
-
"browser": {
|
|
53
|
-
"./src/functions/path_utils/src/path_utils.ts": "./src/functions/path_utils/src/path_utils.browser.ts",
|
|
54
|
-
"./src/functions/read_utils/src/utils.ts": "./src/functions/read_utils/src/utils.browser.ts",
|
|
55
|
-
"fs": false,
|
|
56
|
-
"fs/promises": false,
|
|
57
|
-
"path": "path-browserify"
|
|
58
|
-
},
|
|
59
|
-
"type": "module",
|
|
60
|
-
"author": "putkoff",
|
|
61
|
-
"license": "MIT",
|
|
62
|
-
"typesVersions": {
|
|
63
|
-
"*": {
|
|
64
|
-
"cjs": [
|
|
65
|
-
"dist/index.d.ts"
|
|
66
|
-
],
|
|
67
|
-
"esm": [
|
|
68
|
-
"dist/index.d.ts"
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
92
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function readJsonFile<T = any>(url: string): Promise<T | null>;
|
|
@@ -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;
|