nhb-toolbox 4.0.52 → 4.0.54

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.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sanitizeData = sanitizeData;
4
4
  exports.parseObjectValues = parseObjectValues;
5
- const guards_1 = require("../form/guards");
6
5
  const non_primitives_1 = require("../guards/non-primitives");
7
6
  const primitives_1 = require("../guards/primitives");
8
7
  const basics_1 = require("../string/basics");
@@ -92,9 +91,9 @@ function sanitizeData(input, options) {
92
91
  }
93
92
  else if (value && Array.isArray(value)) {
94
93
  // Keep file arrays untouched
95
- if ((0, guards_1.isFileArray)(value) || (0, guards_1.isCustomFileArray)(value)) {
96
- acc[key] = value;
97
- }
94
+ // if (isFileArray(value) || isCustomFileArray(value)) {
95
+ // acc[key as keyof T] = value as T[keyof T];
96
+ // }
98
97
  // acc[key as keyof T] = value.map(sanitizeData) as T[keyof T];
99
98
  const sanitizedArray = _processArray(value, fullKeyPath);
100
99
  if (!ignoreFalsy || sanitizedArray.length > 0) {
@@ -1,5 +1,19 @@
1
1
  import type { FlattenPartial } from '../types';
2
2
  import type { GenericObject, SanitizeOptions, StrictObject } from './types';
3
+ /**
4
+ * * Trims all the words in a string.
5
+ *
6
+ * @param input String to sanitize.
7
+ * @returns Sanitized string .
8
+ */
9
+ export declare function sanitizeData(input: string): string;
10
+ /**
11
+ * * Trims all the words in an array of strings.
12
+ *
13
+ * @param input Array of strings to sanitize.
14
+ * @returns Sanitized array of strings.
15
+ */
16
+ export declare function sanitizeData(input: string[]): string[];
3
17
  /**
4
18
  * * Sanitizes an object by ignoring specified keys and trimming string values based on options provided.
5
19
  * * Also excludes nullish values (null, undefined) if specified. Always ignores empty nested object(s).
@@ -18,20 +32,6 @@ export declare function sanitizeData<T extends GenericObject>(object: T, options
18
32
  * @returns A new sanitized array with the specified modifications.
19
33
  */
20
34
  export declare function sanitizeData<T>(array: T[], options?: SanitizeOptions<T>): FlattenPartial<T>[];
21
- /**
22
- * * Trims all the words in a string.
23
- *
24
- * @param input String to sanitize.
25
- * @returns Sanitized string .
26
- */
27
- export declare function sanitizeData(input: string): string;
28
- /**
29
- * * Trims all the words in an array of strings.
30
- *
31
- * @param input Array of strings to sanitize.
32
- * @returns Sanitized array of strings.
33
- */
34
- export declare function sanitizeData(input: string[]): string[];
35
35
  /**
36
36
  * * Parse an object of stringified values into their appropriate primitive types.
37
37
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/object/sanitize.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAEX,aAAa,EACb,eAAe,EACf,YAAY,EACZ,MAAM,SAAS,CAAC;AAEjB;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EACnD,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,cAAc,CAAC,CAAC,CAAC,CAAC;AAErB;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AAEvB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAgKxD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAgCrE"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/object/sanitize.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAEX,aAAa,EACb,eAAe,EACf,YAAY,EACZ,MAAM,SAAS,CAAC;AAEjB;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;AAExD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EACnD,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,cAAc,CAAC,CAAC,CAAC,CAAC;AAErB;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;AAgKvB;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAgCrE"}
@@ -1,4 +1,3 @@
1
- import { isCustomFileArray, isFileArray } from '../form/guards';
2
1
  import { isArrayOfType, isNotEmptyObject, isObject, } from '../guards/non-primitives';
3
2
  import { isString } from '../guards/primitives';
4
3
  import { trimString } from '../string/basics';
@@ -88,9 +87,9 @@ export function sanitizeData(input, options) {
88
87
  }
89
88
  else if (value && Array.isArray(value)) {
90
89
  // Keep file arrays untouched
91
- if (isFileArray(value) || isCustomFileArray(value)) {
92
- acc[key] = value;
93
- }
90
+ // if (isFileArray(value) || isCustomFileArray(value)) {
91
+ // acc[key as keyof T] = value as T[keyof T];
92
+ // }
94
93
  // acc[key as keyof T] = value.map(sanitizeData) as T[keyof T];
95
94
  const sanitizedArray = _processArray(value, fullKeyPath);
96
95
  if (!ignoreFalsy || sanitizedArray.length > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.0.52",
3
+ "version": "4.0.54",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions and classes for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",