@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.
Files changed (96) hide show
  1. package/dist/cjs/index.js +771 -355
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +773 -341
  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 -69
  91. package/dist/types/functions/path_utils/src/path_utils.browser.d.ts +0 -2
  92. package/dist/types/functions/path_utils/src/path_utils.node.d.ts +0 -2
  93. package/dist/types/functions/read_utils/src/read_utils.browser.d.ts +0 -1
  94. package/dist/types/functions/read_utils/src/utils.browser.d.ts +0 -3
  95. package/dist/types/functions/url_utils/index.d.ts +0 -1
  96. 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, returnResult?: boolean): Promise<T>;
197
- declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnResult?: boolean): Promise<Blob>;
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: any): T;
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
- * Attempt to load config.json if present, otherwise return empty object.
582
+ * getConfig(): Promise<AppConfig>
583
+ * getConfig(key): Promise<AppConfig[K]>
586
584
  */
587
- declare function getConfigJson(): Promise<Record<string, any>>;
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
- declare function safeNums(...args: Array<number | string | null | undefined>): number[];
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
- * Attempt to load config.json if present, otherwise return empty object.
4
+ * getConfig(): Promise<AppConfig>
5
+ * getConfig(key): Promise<AppConfig[K]>
3
6
  */
4
- export declare function getConfigJson(): Promise<Record<string, any>>;
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
@@ -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, returnResult?: 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, returnResult?: boolean): Promise<Blob>;
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
@@ -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: any): T;
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
@@ -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
@@ -1,2 +1 @@
1
1
  export declare function alertit(obj?: any): void;
2
- export declare const alertIt: typeof alertit;
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
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
- "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.243",
4
- "description": "Reusable abstract utility functions and components for both Node and React.",
5
- "main": "dist/cjs/index.js",
6
- "module": "dist/esm/index.js",
7
- "types": "dist/index.d.ts",
8
- "peerDependencies": {
9
- "react": "^17.0.0 || ^18.0.0 || ^19.0.0",
10
- "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
11
- },
12
- "devDependencies": {
13
- "@putkoff/shared-scripts": "file:../../shared-scripts",
14
- "@rollup/plugin-commonjs": "^25.0.7",
15
- "@rollup/plugin-json": "^6.1.0",
16
- "@rollup/plugin-node-resolve": "^15.2.3",
17
- "@rollup/plugin-typescript": "^11.1.5",
18
- "@testing-library/jest-dom": "^6.4.2",
19
- "@testing-library/react": "^14.2.1",
20
- "@types/jest": "^29.5.12",
21
- "@types/node": "^24.0.13",
22
- "@types/path-browserify": "^1.0.3",
23
- "@types/react": "^18.3.23",
24
- "@types/react-dom": "^18.3.7",
25
- "jest": "^29.7.0",
26
- "postcss": "^8.5.6",
27
- "rollup": "^4.12.0",
28
- "rollup-plugin-dts": "^6.1.0",
29
- "rollup-plugin-peer-deps-external": "^2.2.4",
30
- "rollup-plugin-postcss": "^4.0.2",
31
- "ts-jest": "^29.1.2",
32
- "ts-node": "^10.9.2",
33
- "tslib": "^2.8.1",
34
- "tsx": "^4.20.3",
35
- "typescript": "^5.3.3"
36
- },
37
- "exports": {
38
- ".": {
39
- "import": "./dist/esm/index.js",
40
- "require": "./dist/cjs/index.js",
41
- "types": "./dist/index.d.ts"
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,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;