nhb-toolbox 4.0.44 → 4.0.48

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.
@@ -40,6 +40,9 @@ const generateQueryParams = (params = {}) => {
40
40
  exports.generateQueryParams = generateQueryParams;
41
41
  /**
42
42
  * * Get query params as standard `JavaScript` Object `Record<string, string>`.
43
+ *
44
+ * - **Note:** *Extracts query parameters from the current URL (window.location.search).*
45
+ *
43
46
  * @returns Query string as key-value paired object. `Record<string, string>`.
44
47
  */
45
48
  function getQueryParams() {
@@ -60,6 +63,8 @@ function updateQueryParam(key, value) {
60
63
  * Supports multiple values for the same key by returning arrays.
61
64
  * Optionally parses primitive string values into actual types (e.g., "1" → 1, "true" → true).
62
65
  *
66
+ * - **Note:** *This function does **not** access or depend on `current URL` a.k.a `window.location.search`.*
67
+ *
63
68
  * @param query - The query string to parse.
64
69
  * @param parsePrimitives - Whether to convert stringified primitives into real values (default: true).
65
70
  * @returns An object where keys are strings and values can be string, array, number, boolean, or null.
@@ -212,18 +212,6 @@ const createControlledFormData = (data, configs) => {
212
212
  _addToFormData(key, JSON.stringify(value));
213
213
  }
214
214
  }
215
- // else if (Array.isArray(value) && value.every(isNotEmptyObject)) {
216
- // if (shouldDotNotate(fullKey)) {
217
- // value.forEach((item, index) =>
218
- // _addToFormData(`${fullKey}[${index}]`, item),
219
- // );
220
- // } else if (shouldStringify(fullKey)) {
221
- // _addToFormData(
222
- // key,
223
- // value.map((item) => _processObject(item, parentKey)),
224
- // );
225
- // }
226
- // }
227
215
  else {
228
216
  // * For other cases, just append as key-value
229
217
  _addToFormData(key, value);
@@ -2,7 +2,9 @@
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");
5
6
  const non_primitives_1 = require("../guards/non-primitives");
7
+ const primitives_1 = require("../guards/primitives");
6
8
  const basics_1 = require("../string/basics");
7
9
  /**
8
10
  * * Sanitizes a string, array of strings, an object or array of objects by ignoring specified keys and trimming string values.
@@ -13,9 +15,46 @@ const basics_1 = require("../string/basics");
13
15
  * @returns A new string, object or array of strings or objects with the specified modifications.
14
16
  */
15
17
  function sanitizeData(input, options) {
16
- const { keysToIgnore: ignoreKeys = [], trimStrings = true, ignoreNullish = false, } = options || {};
18
+ const { keysToIgnore = [], requiredKeys = [], trimStrings = true, ignoreNullish = false, ignoreFalsy = false, } = options || {};
17
19
  // Flatten the object keys and use the keys for comparison
18
- const ignoreKeySet = new Set(ignoreKeys);
20
+ const ignoreKeySet = new Set(keysToIgnore);
21
+ const isRequiredKey = (key) => {
22
+ return Array.isArray(requiredKeys) ?
23
+ requiredKeys.some((path) => key === path || key.startsWith(`${path}.`))
24
+ : requiredKeys === '*';
25
+ };
26
+ /**
27
+ * * Recursively process an array and its nested content(s).
28
+ * @param arr Array to process.
29
+ * @param path Full path as dot notation if needed.
30
+ * @returns Processed array.
31
+ */
32
+ const _processArray = (arr, path) => {
33
+ return arr
34
+ .map((item) => {
35
+ if ((0, primitives_1.isString)(item) && trimStrings) {
36
+ return (0, basics_1.trimString)(item);
37
+ }
38
+ if (Array.isArray(item)) {
39
+ // Recursive sanitize
40
+ return _processArray(item, path);
41
+ }
42
+ if ((0, non_primitives_1.isObject)(item)) {
43
+ return _processObject(item, path);
44
+ }
45
+ return item;
46
+ })
47
+ .filter((v) => {
48
+ if (ignoreNullish && v == null)
49
+ return false;
50
+ if (ignoreFalsy && !v)
51
+ return false;
52
+ if (ignoreFalsy && (0, non_primitives_1.isObject)(v) && !(0, non_primitives_1.isNotEmptyObject)(v)) {
53
+ return false;
54
+ }
55
+ return true;
56
+ });
57
+ };
19
58
  /**
20
59
  * * Helper function to process a single object.
21
60
  *
@@ -30,23 +69,38 @@ function sanitizeData(input, options) {
30
69
  return acc;
31
70
  }
32
71
  // Exclude nullish values if specified
33
- if (ignoreNullish && (value === null || value === undefined)) {
72
+ if (ignoreNullish && !isRequiredKey(fullKeyPath) && value == null) {
34
73
  return acc;
35
74
  }
36
- // Trim string values if enabled
37
- if (typeof value === 'string' && trimStrings) {
75
+ // Exclude falsy values `0`, `false`, `null` and `undefined`
76
+ if (ignoreFalsy && !value && !isRequiredKey(fullKeyPath)) {
77
+ return acc;
78
+ }
79
+ if ((0, primitives_1.isString)(value) && trimStrings) {
80
+ // Trim string values if enabled
38
81
  acc[key] = (0, basics_1.trimString)(value);
39
82
  }
40
- else if (value &&
41
- typeof value === 'object' &&
42
- !Array.isArray(value)) {
83
+ else if (value && (0, non_primitives_1.isObject)(value)) {
43
84
  // Recursively process nested objects
44
85
  const processedValue = _processObject(value, fullKeyPath);
45
- // Only add the property if it's not an empty object
46
- if ((0, non_primitives_1.isNotEmptyObject)(processedValue)) {
86
+ // Add the property conditionally if it's not an empty object
87
+ if (!ignoreFalsy ||
88
+ isRequiredKey(fullKeyPath) ||
89
+ (0, non_primitives_1.isNotEmptyObject)(processedValue)) {
47
90
  acc[key] = processedValue;
48
91
  }
49
92
  }
93
+ else if (value && Array.isArray(value)) {
94
+ // Keep file arrays untouched
95
+ if ((0, guards_1.isFileArray)(value) || (0, guards_1.isCustomFileArray)(value)) {
96
+ acc[key] = value;
97
+ }
98
+ // acc[key as keyof T] = value.map(sanitizeData) as T[keyof T];
99
+ const sanitizedArray = _processArray(value, fullKeyPath);
100
+ if (!ignoreFalsy || sanitizedArray.length > 0) {
101
+ acc[key] = sanitizedArray;
102
+ }
103
+ }
50
104
  else {
51
105
  // Add other values as-is
52
106
  acc[key] = value;
@@ -54,22 +108,31 @@ function sanitizeData(input, options) {
54
108
  return acc;
55
109
  }, {});
56
110
  // Process strings
57
- if (typeof input === 'string') {
111
+ if ((0, primitives_1.isString)(input)) {
58
112
  return (0, basics_1.trimString)(input);
59
113
  }
60
114
  // Process array of strings and objects
61
115
  if (Array.isArray(input)) {
62
116
  // Process array of strings
63
- if (typeof input[0] === 'string') {
117
+ if ((0, non_primitives_1.isArrayOfType)(input, primitives_1.isString)) {
64
118
  return (0, basics_1.trimString)(input);
65
119
  }
66
- // Process array of objects
120
+ // * Handle arrays with nested strings/arrays/objects
67
121
  return input
68
- .map((obj) => _processObject(obj))
69
- .filter((obj) => (0, non_primitives_1.isNotEmptyObject)(obj));
122
+ .map((item) => sanitizeData(item, options))
123
+ .filter((val) => {
124
+ if (ignoreNullish && val == null)
125
+ return false;
126
+ if (ignoreFalsy && !val)
127
+ return false;
128
+ if (ignoreFalsy && (0, non_primitives_1.isObject)(val) && !(0, non_primitives_1.isNotEmptyObject)(val)) {
129
+ return false;
130
+ }
131
+ return true;
132
+ });
70
133
  }
71
134
  // Process object
72
- if (typeof input === 'object' && input !== null) {
135
+ if ((0, non_primitives_1.isObject)(input)) {
73
136
  return _processObject(input);
74
137
  }
75
138
  return input;
@@ -87,7 +150,7 @@ function parseObjectValues(object) {
87
150
  const parsedBody = {};
88
151
  if ((0, non_primitives_1.isNotEmptyObject)(object)) {
89
152
  Object.entries(object).forEach(([key, value]) => {
90
- if (typeof value !== 'string') {
153
+ if (!(0, primitives_1.isString)(value)) {
91
154
  parsedBody[key] = value;
92
155
  return;
93
156
  }
@@ -16,6 +16,9 @@ import type { QueryString } from '../string/types';
16
16
  export declare const generateQueryParams: <T extends QueryObject>(params?: T) => QueryString;
17
17
  /**
18
18
  * * Get query params as standard `JavaScript` Object `Record<string, string>`.
19
+ *
20
+ * - **Note:** *Extracts query parameters from the current URL (window.location.search).*
21
+ *
19
22
  * @returns Query string as key-value paired object. `Record<string, string>`.
20
23
  */
21
24
  export declare function getQueryParams(): Record<string, string>;
@@ -30,6 +33,8 @@ export declare function updateQueryParam(key: string, value: string): void;
30
33
  * Supports multiple values for the same key by returning arrays.
31
34
  * Optionally parses primitive string values into actual types (e.g., "1" → 1, "true" → true).
32
35
  *
36
+ * - **Note:** *This function does **not** access or depend on `current URL` a.k.a `window.location.search`.*
37
+ *
33
38
  * @param query - The query string to parse.
34
39
  * @param parsePrimitives - Whether to convert stringified primitives into real values (default: true).
35
40
  * @returns An object where keys are strings and values can be string, array, number, boolean, or null.
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/dom/query.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,WAAW,WAChD,CAAC,KACP,WAkCF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAI1D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,UACrB,MAAM,gCAEX,YAqBF,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/dom/query.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,WAAW,WAChD,CAAC,KACP,WAkCF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAI1D;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,UACrB,MAAM,gCAEX,YAqBF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/form/convert.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEX,aAAa,EAEb,MAAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,aAAa,QACzD,CAAC,YACG,eAAe,CAAC,CAAC,CAAC,KAC1B,QAkQF,CAAC"}
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/form/convert.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAEX,aAAa,EAEb,MAAM,iBAAiB,CAAC;AAQzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,aAAa,QACzD,CAAC,YACG,eAAe,CAAC,CAAC,CAAC,KAC1B,QAqPF,CAAC"}
@@ -10,14 +10,14 @@ import type { GenericObject, SanitizeOptions, StrictObject } from './types';
10
10
  */
11
11
  export declare function sanitizeData<T extends GenericObject>(object: T, options?: SanitizeOptions<T>): FlattenPartial<T>;
12
12
  /**
13
- * * Sanitizes an array of objects by ignoring specified keys and trimming string values based on options provided.
14
- * * Also excludes nullish values (null, undefined) if specified. Always ignores empty nested object(s).
13
+ * * Sanitizes a deeply nested array that may contain arrays, objects or other (mixed) data types.
14
+ * * Preserves structure while removing empty values and trimming strings and other operations.
15
15
  *
16
- * @param object - The object to sanitize.
17
- * @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish values.
18
- * @returns A new array of objects with the specified modifications.
16
+ * @param array - A mixed array that may contain arrays, objects or other data types.
17
+ * @param options - Options to trim and filter values.
18
+ * @returns A new sanitized array with the specified modifications.
19
19
  */
20
- export declare function sanitizeData<T extends GenericObject>(array: T[], options?: SanitizeOptions<T>): FlattenPartial<T>[];
20
+ export declare function sanitizeData<T>(array: T[], options?: SanitizeOptions<T>): FlattenPartial<T>[];
21
21
  /**
22
22
  * * Trims all the words in a string.
23
23
  *
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../src/object/sanitize.ts"],"names":[],"mappings":"AAEA,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,SAAS,aAAa,EACnD,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;AA4FxD;;;;;;;;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":"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"}
@@ -41,14 +41,26 @@ export type NestedKeyString<T> = T extends AdvancedTypes ? never : T extends Gen
41
41
  export type NestedPrimitiveKey<T> = T extends AdvancedTypes ? never : T extends GenericObject ? {
42
42
  [K in keyof T & string]: NonNullable<T[K]> extends Primitive ? K : NonNullable<T[K]> extends GenericObject ? `${K}.${NestedPrimitiveKey<NonNullable<T[K]>>}` : never;
43
43
  }[keyof T & string] : never;
44
- /** - Options for `sanitizeData` */
45
- export interface SanitizeOptions<T extends GenericObject> {
46
- /** Keys to ignore */
44
+ /** - Options for `sanitizeData` utility. */
45
+ export interface SanitizeOptions<T> {
46
+ /**
47
+ * An array of dot-notation keys to exclude from the sanitized output.
48
+ * This is only applicable when sanitizing plain objects or arrays of objects.
49
+ * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
50
+ */
47
51
  keysToIgnore?: DotNotationKey<T>[];
48
- /** Whether to trim string values. Defaults to `true` */
52
+ /** Whether to trim string values. Defaults to `true`. */
49
53
  trimStrings?: boolean;
50
- /** Whether to exclude nullish (null or undefined) values. Defaults to `false` */
54
+ /** Whether to exclude nullish (`null` or `undefined`) values. Defaults to `false`. */
51
55
  ignoreNullish?: boolean;
56
+ /** Whether to exclude all falsy values (`false`, `0`, `empty string: ''`, `null`, `undefined` and `empty object and arrays` (`{}`, `[]`)). Defaults to `false`. */
57
+ ignoreFalsy?: boolean;
58
+ /**
59
+ * An array of dot-notation key paths that must be preserved in the sanitized output.
60
+ * Use `"*"` to retain all keys. This applies primarily to plain or nested objects and arrays of objects.
61
+ * When applied to nested or irregular array structures, behavior may be inconsistent or partially ignored.
62
+ */
63
+ requiredKeys?: '*' | DotNotationKey<T>[];
52
64
  }
53
65
  /** - Data after sanitization.
54
66
  * ! Unused
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/object/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAEzD,4CAA4C;AAC5C,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,4CAA4C;AAC5C,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEhD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,WAAW,CAAC;AAErE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAA;CAAE,CAAC;AAE9D,4EAA4E;AAC5E,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;AAE/E,gGAAgG;AAChG,MAAM,MAAM,oBAAoB,CAAC,CAAC,IACjC,CAAC,SAAS,aAAa,GAAG,KAAK,GAC7B,CAAC,SAAS,YAAY,GACvB;KACE,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,YAAY,GAC9D,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,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,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GACzD,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1D,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GACrC,CAAC,CAAC,CAAC,CAAC;CACN,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC3B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GACzD,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAC1D,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAC5B,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAC1B,MAAM;CACR,CAAC;AAEF,uFAAuF;AACvF,MAAM,MAAM,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI;KACrC,CAAC,IAAI,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC;CACnD,CAAC"}
@@ -34,6 +34,9 @@ export const generateQueryParams = (params = {}) => {
34
34
  };
35
35
  /**
36
36
  * * Get query params as standard `JavaScript` Object `Record<string, string>`.
37
+ *
38
+ * - **Note:** *Extracts query parameters from the current URL (window.location.search).*
39
+ *
37
40
  * @returns Query string as key-value paired object. `Record<string, string>`.
38
41
  */
39
42
  export function getQueryParams() {
@@ -54,6 +57,8 @@ export function updateQueryParam(key, value) {
54
57
  * Supports multiple values for the same key by returning arrays.
55
58
  * Optionally parses primitive string values into actual types (e.g., "1" → 1, "true" → true).
56
59
  *
60
+ * - **Note:** *This function does **not** access or depend on `current URL` a.k.a `window.location.search`.*
61
+ *
57
62
  * @param query - The query string to parse.
58
63
  * @param parsePrimitives - Whether to convert stringified primitives into real values (default: true).
59
64
  * @returns An object where keys are strings and values can be string, array, number, boolean, or null.
@@ -209,18 +209,6 @@ export const createControlledFormData = (data, configs) => {
209
209
  _addToFormData(key, JSON.stringify(value));
210
210
  }
211
211
  }
212
- // else if (Array.isArray(value) && value.every(isNotEmptyObject)) {
213
- // if (shouldDotNotate(fullKey)) {
214
- // value.forEach((item, index) =>
215
- // _addToFormData(`${fullKey}[${index}]`, item),
216
- // );
217
- // } else if (shouldStringify(fullKey)) {
218
- // _addToFormData(
219
- // key,
220
- // value.map((item) => _processObject(item, parentKey)),
221
- // );
222
- // }
223
- // }
224
212
  else {
225
213
  // * For other cases, just append as key-value
226
214
  _addToFormData(key, value);
@@ -1,4 +1,6 @@
1
- import { isNotEmptyObject } from '../guards/non-primitives';
1
+ import { isCustomFileArray, isFileArray } from '../form/guards';
2
+ import { isArrayOfType, isNotEmptyObject, isObject, } from '../guards/non-primitives';
3
+ import { isString } from '../guards/primitives';
2
4
  import { trimString } from '../string/basics';
3
5
  /**
4
6
  * * Sanitizes a string, array of strings, an object or array of objects by ignoring specified keys and trimming string values.
@@ -9,9 +11,46 @@ import { trimString } from '../string/basics';
9
11
  * @returns A new string, object or array of strings or objects with the specified modifications.
10
12
  */
11
13
  export function sanitizeData(input, options) {
12
- const { keysToIgnore: ignoreKeys = [], trimStrings = true, ignoreNullish = false, } = options || {};
14
+ const { keysToIgnore = [], requiredKeys = [], trimStrings = true, ignoreNullish = false, ignoreFalsy = false, } = options || {};
13
15
  // Flatten the object keys and use the keys for comparison
14
- const ignoreKeySet = new Set(ignoreKeys);
16
+ const ignoreKeySet = new Set(keysToIgnore);
17
+ const isRequiredKey = (key) => {
18
+ return Array.isArray(requiredKeys) ?
19
+ requiredKeys.some((path) => key === path || key.startsWith(`${path}.`))
20
+ : requiredKeys === '*';
21
+ };
22
+ /**
23
+ * * Recursively process an array and its nested content(s).
24
+ * @param arr Array to process.
25
+ * @param path Full path as dot notation if needed.
26
+ * @returns Processed array.
27
+ */
28
+ const _processArray = (arr, path) => {
29
+ return arr
30
+ .map((item) => {
31
+ if (isString(item) && trimStrings) {
32
+ return trimString(item);
33
+ }
34
+ if (Array.isArray(item)) {
35
+ // Recursive sanitize
36
+ return _processArray(item, path);
37
+ }
38
+ if (isObject(item)) {
39
+ return _processObject(item, path);
40
+ }
41
+ return item;
42
+ })
43
+ .filter((v) => {
44
+ if (ignoreNullish && v == null)
45
+ return false;
46
+ if (ignoreFalsy && !v)
47
+ return false;
48
+ if (ignoreFalsy && isObject(v) && !isNotEmptyObject(v)) {
49
+ return false;
50
+ }
51
+ return true;
52
+ });
53
+ };
15
54
  /**
16
55
  * * Helper function to process a single object.
17
56
  *
@@ -26,23 +65,38 @@ export function sanitizeData(input, options) {
26
65
  return acc;
27
66
  }
28
67
  // Exclude nullish values if specified
29
- if (ignoreNullish && (value === null || value === undefined)) {
68
+ if (ignoreNullish && !isRequiredKey(fullKeyPath) && value == null) {
30
69
  return acc;
31
70
  }
32
- // Trim string values if enabled
33
- if (typeof value === 'string' && trimStrings) {
71
+ // Exclude falsy values `0`, `false`, `null` and `undefined`
72
+ if (ignoreFalsy && !value && !isRequiredKey(fullKeyPath)) {
73
+ return acc;
74
+ }
75
+ if (isString(value) && trimStrings) {
76
+ // Trim string values if enabled
34
77
  acc[key] = trimString(value);
35
78
  }
36
- else if (value &&
37
- typeof value === 'object' &&
38
- !Array.isArray(value)) {
79
+ else if (value && isObject(value)) {
39
80
  // Recursively process nested objects
40
81
  const processedValue = _processObject(value, fullKeyPath);
41
- // Only add the property if it's not an empty object
42
- if (isNotEmptyObject(processedValue)) {
82
+ // Add the property conditionally if it's not an empty object
83
+ if (!ignoreFalsy ||
84
+ isRequiredKey(fullKeyPath) ||
85
+ isNotEmptyObject(processedValue)) {
43
86
  acc[key] = processedValue;
44
87
  }
45
88
  }
89
+ else if (value && Array.isArray(value)) {
90
+ // Keep file arrays untouched
91
+ if (isFileArray(value) || isCustomFileArray(value)) {
92
+ acc[key] = value;
93
+ }
94
+ // acc[key as keyof T] = value.map(sanitizeData) as T[keyof T];
95
+ const sanitizedArray = _processArray(value, fullKeyPath);
96
+ if (!ignoreFalsy || sanitizedArray.length > 0) {
97
+ acc[key] = sanitizedArray;
98
+ }
99
+ }
46
100
  else {
47
101
  // Add other values as-is
48
102
  acc[key] = value;
@@ -50,22 +104,31 @@ export function sanitizeData(input, options) {
50
104
  return acc;
51
105
  }, {});
52
106
  // Process strings
53
- if (typeof input === 'string') {
107
+ if (isString(input)) {
54
108
  return trimString(input);
55
109
  }
56
110
  // Process array of strings and objects
57
111
  if (Array.isArray(input)) {
58
112
  // Process array of strings
59
- if (typeof input[0] === 'string') {
113
+ if (isArrayOfType(input, isString)) {
60
114
  return trimString(input);
61
115
  }
62
- // Process array of objects
116
+ // * Handle arrays with nested strings/arrays/objects
63
117
  return input
64
- .map((obj) => _processObject(obj))
65
- .filter((obj) => isNotEmptyObject(obj));
118
+ .map((item) => sanitizeData(item, options))
119
+ .filter((val) => {
120
+ if (ignoreNullish && val == null)
121
+ return false;
122
+ if (ignoreFalsy && !val)
123
+ return false;
124
+ if (ignoreFalsy && isObject(val) && !isNotEmptyObject(val)) {
125
+ return false;
126
+ }
127
+ return true;
128
+ });
66
129
  }
67
130
  // Process object
68
- if (typeof input === 'object' && input !== null) {
131
+ if (isObject(input)) {
69
132
  return _processObject(input);
70
133
  }
71
134
  return input;
@@ -83,7 +146,7 @@ export function parseObjectValues(object) {
83
146
  const parsedBody = {};
84
147
  if (isNotEmptyObject(object)) {
85
148
  Object.entries(object).forEach(([key, value]) => {
86
- if (typeof value !== 'string') {
149
+ if (!isString(value)) {
87
150
  parsedBody[key] = value;
88
151
  return;
89
152
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.0.44",
3
+ "version": "4.0.48",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",