@putkoff/abstract-utilities 0.1.236 → 0.1.239
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 +78 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +71 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +21 -1
- package/dist/types/functions/index.d.ts +1 -0
- package/dist/types/functions/url_utils/index.d.ts +1 -0
- package/dist/types/functions/url_utils/uri_utils.d.ts +19 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -424,5 +424,25 @@ declare function safeDivide(...args: Array<number | string | null | undefined>):
|
|
|
424
424
|
declare function safeMultiply(...args: Array<number | string | null | undefined>): number;
|
|
425
425
|
declare function roundPercentage(x: any): number;
|
|
426
426
|
|
|
427
|
-
|
|
427
|
+
/** Encode a single query value/key safely */
|
|
428
|
+
declare const encode: (v: unknown) => string;
|
|
429
|
+
/** Decode a single query value/key safely (never throws) */
|
|
430
|
+
declare const decodeSafe: (v: string | null | undefined) => string;
|
|
431
|
+
/** Decode strings that might be double-encoded (up to 2 passes) */
|
|
432
|
+
declare const decodeMaybeDouble: (v: string) => string;
|
|
433
|
+
/** Convert + to spaces (legacy www-form behavior) then decode */
|
|
434
|
+
declare const decodeFormComponent: (v: string) => string;
|
|
435
|
+
/** Build a URL with query params (skips null/undefined) */
|
|
436
|
+
declare const buildUrl: (base: string, params?: Record<string, unknown>) => string;
|
|
437
|
+
/** Parse a query string into an object (first value wins; arrays if repeat=true) */
|
|
438
|
+
declare const parseQuery: (qs: string, opts?: {
|
|
439
|
+
repeat?: boolean;
|
|
440
|
+
form?: boolean;
|
|
441
|
+
}) => Record<string, any>;
|
|
442
|
+
/** Quick helper: percent-encode whole strings for placement in URLs */
|
|
443
|
+
declare const encodeTextForUrl: (text: string) => string;
|
|
444
|
+
/** Quick helper: decode long blobs coming from share-intents/UTMs */
|
|
445
|
+
declare const decodeShareBlob: (blob: string) => string;
|
|
446
|
+
|
|
447
|
+
export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, 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, 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, getAlphaNum, getAlphas, getAuthorizationHeader, getBaseDir, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfigContent, getConfigJson, getConfigVar, getDbConfigsPath, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMethod, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, getWindowHost, getWindowProp, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_relative_path, get_result, get_safe_path, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isNum, isStrInString, isTokenExpired, isType, 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 };
|
|
428
448
|
export type { ApiRow, AppConfig, ChangePasswordFormProps, ChangePasswordProps, FetchVariables, FileItem, FileListResponse, InputProps, JwtPayload, LoginFormProps, LoginProps, LogoutButtonProps, Promise$1 as Promise, UrlKey };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './uri_utils';
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putkoff/abstract-utilities",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.239",
|
|
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",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@testing-library/react": "^14.2.1",
|
|
20
20
|
"@types/jest": "^29.5.12",
|
|
21
21
|
"@types/node": "^24.0.13",
|
|
22
|
+
"@types/path-browserify": "^1.0.3",
|
|
22
23
|
"@types/react": "^18.3.23",
|
|
23
24
|
"@types/react-dom": "^18.3.7",
|
|
24
25
|
"jest": "^29.7.0",
|