@putkoff/abstract-utilities 0.1.195 → 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/index.d.ts CHANGED
@@ -235,7 +235,14 @@ declare function get_splitext(filePath: string | null): {
235
235
  ext: string;
236
236
  extname?: undefined;
237
237
  };
238
- declare function make_path(...segments: string[]): string;
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;
239
246
  declare function sanitizeFilename(filename: string): string;
240
247
  declare function make_sanitized_path(...paths: string[]): string;
241
248
  declare function normalizeUrl(base: string, p?: string): string;
@@ -311,6 +318,13 @@ declare function tryParse(obj: any): any;
311
318
  declare function create_list_string(array_obj: any): string;
312
319
 
313
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[];
314
328
 
315
329
  declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
316
330
  color?: 'gray' | 'green' | 'blue';
@@ -337,5 +351,21 @@ declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
337
351
  declare function getConfig(): Promise<AppConfig>;
338
352
  declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
339
353
 
340
- export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertit, callStorage, callWindowMethod, checkResponse, 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, getAbsDir, getAbsPath, getAuthorizationHeader, getBaseDir, getBody, 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_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isTokenExpired, loadConfig, make_path, make_sanitized_path, normalizeUrl, parseResult, readJsonFile, requireToken, safeGlobalProp, safeStorage, sanitizeFilename, stripPrefixes, truncateString, tryParse };
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 };
341
371
  export type { ApiRow, AppConfig, ChangePasswordFormProps, ChangePasswordProps, FetchVariables, FileItem, FileListResponse, InputProps, JwtPayload, LoginFormProps, LoginProps, LogoutButtonProps, Promise$1 as Promise, UrlKey };
@@ -12,3 +12,4 @@ export * from './config_utils';
12
12
  export * from './read_utils';
13
13
  export * from './safe_utils';
14
14
  export * from './read_utils';
15
+ export * from './variable_utils';
@@ -11,7 +11,14 @@ export declare function get_splitext(filePath: string | null): {
11
11
  ext: string;
12
12
  extname?: undefined;
13
13
  };
14
- export declare function make_path(...segments: string[]): string;
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;
@@ -1 +1,8 @@
1
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 './src';
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.195",
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
+ }