nhb-toolbox 2.4.6 → 2.4.8
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/README.md +3 -3
- package/dist/array/basics.d.ts +2 -2
- package/dist/array/basics.d.ts.map +1 -1
- package/dist/array/sort.d.ts +2 -2
- package/dist/array/sort.d.ts.map +1 -1
- package/dist/array/transform.d.ts +2 -2
- package/dist/array/transform.d.ts.map +1 -1
- package/dist/array/types.d.ts +3 -3
- package/dist/array/types.d.ts.map +1 -1
- package/dist/form/convert.d.ts +2 -2
- package/dist/form/convert.d.ts.map +1 -1
- package/dist/form/transform.d.ts +2 -2
- package/dist/form/transform.d.ts.map +1 -1
- package/dist/form/types.d.ts +5 -5
- package/dist/form/types.d.ts.map +1 -1
- package/dist/object/basics.d.ts +4 -4
- package/dist/object/basics.d.ts.map +1 -1
- package/dist/object/convert.d.ts +5 -5
- package/dist/object/convert.d.ts.map +1 -1
- package/dist/object/objectify.d.ts +8 -8
- package/dist/object/objectify.d.ts.map +1 -1
- package/dist/object/sanitize.d.ts +3 -3
- package/dist/object/sanitize.d.ts.map +1 -1
- package/dist/object/types.d.ts +8 -8
- package/dist/object/types.d.ts.map +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# NHB ToolBox
|
|
2
|
-
|
|
3
|
-
- A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.
|
|
1
|
+
# NHB ToolBox
|
|
2
|
+
|
|
3
|
+
- A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.
|
package/dist/array/basics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject } from '../object/types';
|
|
2
2
|
import type { Flattened } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* * Flattens a nested array recursively or wraps any non-array data type in an array.
|
|
@@ -18,7 +18,7 @@ export declare const flattenArray: <T>(input: T | T[]) => Flattened<T>[];
|
|
|
18
18
|
* @returns The filtered array of objects.
|
|
19
19
|
* @throws {Error} If the input is not a valid array.
|
|
20
20
|
*/
|
|
21
|
-
export declare const filterArrayOfObjects: <T extends
|
|
21
|
+
export declare const filterArrayOfObjects: <T extends GenericObject>(array: T[], conditions: { [K in keyof T]?: (value: T[K] | undefined) => boolean; }) => T[];
|
|
22
22
|
/**
|
|
23
23
|
* * Checks if a value is an empty array or an array with only empty values.
|
|
24
24
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basics.d.ts","sourceRoot":"","sources":["../../src/array/basics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"basics.d.ts","sourceRoot":"","sources":["../../src/array/basics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAG,SAAS,CAAC,CAAC,CAAC,EAO5D,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,aAAa,SACpD,CAAC,EAAE,cACE,GAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,KAAK,OAAO,GAAE,KACnE,CAAC,EAeH,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAG,OAWrD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,EAAE,KAAG,CAAC,EAW7C,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,CAAC,EAAE,KAAG,CAAC,GAAG,SAEvD,CAAC"}
|
package/dist/array/sort.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject } from '../object/types';
|
|
2
2
|
import type { OrderOption, SortByOption } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* * Sorts an array of strings.
|
|
@@ -34,5 +34,5 @@ export declare function sortAnArray(array: boolean[], options?: OrderOption): bo
|
|
|
34
34
|
* @param options - Sorting options.
|
|
35
35
|
* @returns The sorted array.
|
|
36
36
|
*/
|
|
37
|
-
export declare function sortAnArray<T extends
|
|
37
|
+
export declare function sortAnArray<T extends GenericObject>(array: T[], options: SortByOption<T>): T[];
|
|
38
38
|
//# sourceMappingURL=sort.d.ts.map
|
package/dist/array/sort.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/array/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../../src/array/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAe,MAAM,SAAS,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE,CAAC;AAE9E;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,EAAE,CAAC;AAEhF;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,aAAa,EAClD,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,GACtB,CAAC,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject } from '../object/types';
|
|
2
2
|
import type { OptionsConfig } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* * Converts an array of objects into a formatted array of options.
|
|
@@ -8,7 +8,7 @@ import type { OptionsConfig } from './types';
|
|
|
8
8
|
* @param config - The configuration object to specify the keys for the `value` (firstFieldName) and `label` (secondFieldName) fields and rename as needed.
|
|
9
9
|
* @returns An array of options, where each option has `value` and `label` fields as default or as specified by user in the config options.
|
|
10
10
|
*/
|
|
11
|
-
export declare const createOptionsArray: <T extends
|
|
11
|
+
export declare const createOptionsArray: <T extends GenericObject, K1 extends string = "value", K2 extends string = "label">(data: T[], config: OptionsConfig<T, K1, K2>) => { [P in K1 | K2]: string; }[];
|
|
12
12
|
/**
|
|
13
13
|
* * Removes duplicate values from an array, supporting deep comparison for objects and arrays.
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/array/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/array/transform.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC9B,CAAC,SAAS,aAAa,EACvB,EAAE,SAAS,MAAM,YACjB,EAAE,SAAS,MAAM,kBAEX,CAAC,EAAE,UACD,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,KAC9B,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,GAAE,EAgB5B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAK5D"}
|
package/dist/array/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject, NestedPrimitiveKey } from '../object/types';
|
|
2
2
|
import type { PrimitiveKey } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* * Flatten Array or Wrap in Array
|
|
@@ -51,7 +51,7 @@ export interface OrderOption {
|
|
|
51
51
|
* * Options for setting sortByField for sorting an array of objects.
|
|
52
52
|
* @template T - The type of objects in the array.
|
|
53
53
|
*/
|
|
54
|
-
export interface SortByOption<T extends
|
|
54
|
+
export interface SortByOption<T extends GenericObject> extends OrderOption {
|
|
55
55
|
/** The field by which to sort the objects in the array. */
|
|
56
56
|
sortByField: NestedPrimitiveKey<T>;
|
|
57
57
|
}
|
|
@@ -59,6 +59,6 @@ export interface SortByOption<T extends GenericObjectAny> extends OrderOption {
|
|
|
59
59
|
* * Options for sorting an array of objects.
|
|
60
60
|
* @template T - The type of objects in the array.
|
|
61
61
|
*/
|
|
62
|
-
export interface SortOptions<T extends
|
|
62
|
+
export interface SortOptions<T extends GenericObject> extends Partial<SortByOption<T>> {
|
|
63
63
|
}
|
|
64
64
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/array/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/array/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C;;;;MAIM;AACN,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAEpE;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE;IACvC;;;OAGG;IACH,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAE/B;;;OAGG;IACH,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAEhC;;;;OAIG;IACH,cAAc,CAAC,EAAE,EAAE,CAAC;IAEpB;;;;OAIG;IACH,eAAe,CAAC,EAAE,EAAE,CAAC;CACrB;AAED,kCAAkC;AAClC,MAAM,WAAW,WAAW;IAC3B;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,aAAa,CAAE,SAAQ,WAAW;IACzE,2DAA2D;IAC3D,WAAW,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,aAAa,CACnD,SAAQ,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;CAAG"}
|
package/dist/form/convert.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject } from '../object/types';
|
|
2
2
|
/**
|
|
3
3
|
* * Utility to convert object into FormData.
|
|
4
4
|
*
|
|
5
5
|
* @param data Data to convert into FormData.
|
|
6
6
|
* @returns Converted FormData.
|
|
7
7
|
*/
|
|
8
|
-
export declare const convertIntoFormData: <T extends
|
|
8
|
+
export declare const convertIntoFormData: <T extends GenericObject>(data: T) => FormData;
|
|
9
9
|
/**
|
|
10
10
|
* * Check if a formdata object is empty.
|
|
11
11
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/form/convert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/form/convert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,aAAa,QACpD,CAAC,KACL,QAYF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SAAU,QAAQ,KAAG,OAQhD,CAAC"}
|
package/dist/form/transform.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject } from '../object/types';
|
|
2
2
|
import type { FormDataConfigs } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Utility to convert object into FormData in a controlled way.
|
|
@@ -8,5 +8,5 @@ import type { FormDataConfigs } from './types';
|
|
|
8
8
|
*
|
|
9
9
|
* @returns FormData instance containing the sanitized and transformed data
|
|
10
10
|
*/
|
|
11
|
-
export declare const createControlledFormData: <T extends
|
|
11
|
+
export declare const createControlledFormData: <T extends GenericObject>(data: T, configs?: FormDataConfigs<T>) => FormData;
|
|
12
12
|
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/form/transform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/form/transform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,aAAa,QACzD,CAAC,YACG,eAAe,CAAC,CAAC,CAAC,KAC1B,QAqFF,CAAC"}
|
package/dist/form/types.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DotNotationKey } from '../object/types';
|
|
2
2
|
export interface FormDataConfigs<T> {
|
|
3
3
|
/** - Keys to exclude from processing. Ignored keys are ignored even if they're in other options */
|
|
4
|
-
ignoreKeys?:
|
|
4
|
+
ignoreKeys?: DotNotationKey<T>[];
|
|
5
5
|
/** - Keys to preserve even if falsy. `*` to include all keys */
|
|
6
|
-
requiredKeys?: '*' |
|
|
6
|
+
requiredKeys?: '*' | DotNotationKey<T>[];
|
|
7
7
|
/** - Keys to convert to lowercase. `*` to include all keys */
|
|
8
|
-
lowerCaseKeys?: '*' |
|
|
8
|
+
lowerCaseKeys?: '*' | DotNotationKey<T>[];
|
|
9
9
|
/** - Dot-notation paths to preserve (e.g., 'user.settings.theme'). `*` to include all keys */
|
|
10
|
-
preservePaths?: '*' |
|
|
10
|
+
preservePaths?: '*' | DotNotationKey<T>[];
|
|
11
11
|
/** - Whether to trim string values */
|
|
12
12
|
trimStrings?: boolean;
|
|
13
13
|
}
|
package/dist/form/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/form/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,MAAM,WAAW,eAAe,CAAC,CAAC;IACjC,mGAAmG;IACnG,UAAU,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IACjC,gEAAgE;IAChE,YAAY,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,+DAA+D;IAC/D,aAAa,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,8FAA8F;IAC9F,aAAa,CAAC,EAAE,GAAG,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAC1C,sCAAsC;IACtC,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB"}
|
package/dist/object/basics.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject, QueryObject } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* * Utility to generate query parameters from an object.
|
|
4
4
|
*
|
|
@@ -20,21 +20,21 @@ export declare const generateQueryParams: <T extends QueryObject>(params?: T) =>
|
|
|
20
20
|
* @param obj Object to clone.
|
|
21
21
|
* @returns Deep cloned object.
|
|
22
22
|
*/
|
|
23
|
-
export declare const cloneObject: <T extends
|
|
23
|
+
export declare const cloneObject: <T extends GenericObject>(obj: T) => T;
|
|
24
24
|
/**
|
|
25
25
|
* * Check if an object is empty.
|
|
26
26
|
*
|
|
27
27
|
* @param obj Object to check.
|
|
28
28
|
* @returns Whether the object is empty.
|
|
29
29
|
*/
|
|
30
|
-
export declare const isEmptyObject: <T extends
|
|
30
|
+
export declare const isEmptyObject: <T extends GenericObject>(obj: T) => boolean;
|
|
31
31
|
/**
|
|
32
32
|
* * Count the number of fields in an object.
|
|
33
33
|
*
|
|
34
34
|
* @param obj Object to check.
|
|
35
35
|
* @returns Number of fields in the object.
|
|
36
36
|
*/
|
|
37
|
-
export declare const countObjectFields: <T extends
|
|
37
|
+
export declare const countObjectFields: <T extends GenericObject>(obj: T) => number;
|
|
38
38
|
/**
|
|
39
39
|
* * Check whether data is object and not array.
|
|
40
40
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basics.d.ts","sourceRoot":"","sources":["../../src/object/basics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"basics.d.ts","sourceRoot":"","sources":["../../src/object/basics.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,WAAW,WAChD,CAAC,KACP,MAkCF,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,aAAa,OAAO,CAAC,KAAG,CAE7D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,aAAa,OAAO,CAAC,KAAG,OAI/D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,aAAa,OAAO,CAAC,KAAG,MAInE,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,SAAU,OAAO,KAAG,OAExC,CAAC"}
|
package/dist/object/convert.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DotNotationKey, GenericObject, Numberified, Stringified } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* * Converts the values of specified keys in an object to numbers.
|
|
4
4
|
* * Supports nested objects using dot-notation keys.
|
|
@@ -9,8 +9,8 @@ import type { DotNotationKeyAny, GenericObjectAny, Numberified, Stringified } fr
|
|
|
9
9
|
* - `convertTo`: The target type, either `"string"` or `"number"`.
|
|
10
10
|
* @returns The modified object with the converted values as `"string"` or `"number"`.
|
|
11
11
|
*/
|
|
12
|
-
export declare function convertObjectValues<T extends
|
|
13
|
-
keys:
|
|
12
|
+
export declare function convertObjectValues<T extends GenericObject, C extends 'string' | 'number'>(data: T, options: {
|
|
13
|
+
keys: DotNotationKey<T>[];
|
|
14
14
|
convertTo: C;
|
|
15
15
|
}): C extends 'string' ? Stringified<T> : C extends 'number' ? Numberified<T> : never;
|
|
16
16
|
/**
|
|
@@ -23,8 +23,8 @@ export declare function convertObjectValues<T extends GenericObjectAny, C extend
|
|
|
23
23
|
* - `convertTo`: The target type, either `"string"` or `"number"`.
|
|
24
24
|
* @returns The modified array of objects with the converted values as `"string"` or `"number"`.
|
|
25
25
|
*/
|
|
26
|
-
export declare function convertObjectValues<T extends
|
|
27
|
-
keys:
|
|
26
|
+
export declare function convertObjectValues<T extends GenericObject, C extends 'string' | 'number'>(data: T[], options: {
|
|
27
|
+
keys: DotNotationKey<T>[];
|
|
28
28
|
convertTo: C;
|
|
29
29
|
}): C extends 'string' ? Stringified<T>[] : C extends 'number' ? Numberified<T>[] : never;
|
|
30
30
|
//# sourceMappingURL=convert.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/object/convert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../src/object/convert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACX,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAE7B,IAAI,EAAE,CAAC,EACP,OAAO,EAAE;IAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,SAAS,EAAE,CAAC,CAAA;CAAE,GAClD,CAAC,SAAS,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,GACpC,CAAC,SAAS,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,GACnC,KAAK,CAAC;AAER;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAClC,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAE7B,IAAI,EAAE,CAAC,EAAE,EACT,OAAO,EAAE;IAAE,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,SAAS,EAAE,CAAC,CAAA;CAAE,GAClD,CAAC,SAAS,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GACtC,CAAC,SAAS,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,GACrC,KAAK,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* * Deeply merge two or more objects using `Map`.
|
|
4
4
|
*
|
|
5
5
|
* @param objects Objects to merge.
|
|
6
6
|
* @returns Merged object.
|
|
7
7
|
*/
|
|
8
|
-
export declare const mergeObjects: <T extends
|
|
8
|
+
export declare const mergeObjects: <T extends GenericObject>(...objects: T[]) => T;
|
|
9
9
|
/**
|
|
10
10
|
* * Deeply merge objects and flatten nested objects.
|
|
11
11
|
* * Useful for flattening a single object or merging multiple objects with duplicate key(s).
|
|
@@ -14,21 +14,21 @@ export declare const mergeObjects: <T extends GenericObjectAny>(...objects: T[])
|
|
|
14
14
|
* @param objects Objects to merge.
|
|
15
15
|
* @returns Merged object with flattened structure.
|
|
16
16
|
*/
|
|
17
|
-
export declare const mergeAndFlattenObjects: <T extends
|
|
17
|
+
export declare const mergeAndFlattenObjects: <T extends GenericObject>(...objects: T[]) => GenericObject;
|
|
18
18
|
/**
|
|
19
19
|
* * Flattens a nested object into key-value format.
|
|
20
20
|
*
|
|
21
21
|
* @param object - The `object` to flatten.
|
|
22
22
|
* @returns A `flattened object` in key-value format.
|
|
23
23
|
*/
|
|
24
|
-
export declare const flattenObjectKeyValue: <T extends
|
|
24
|
+
export declare const flattenObjectKeyValue: <T extends GenericObject>(object: T) => T;
|
|
25
25
|
/**
|
|
26
26
|
* * Flattens a nested object into a dot notation format.
|
|
27
27
|
*
|
|
28
28
|
* @param object - The `object` to flatten.
|
|
29
29
|
* @returns A `flattened object` with dot notation keys.
|
|
30
30
|
*/
|
|
31
|
-
export declare const flattenObjectDotNotation: <T extends
|
|
31
|
+
export declare const flattenObjectDotNotation: <T extends GenericObject>(object: T) => GenericObject;
|
|
32
32
|
/**
|
|
33
33
|
* * Extracts only the fields that have changed between the original and updated object.
|
|
34
34
|
*
|
|
@@ -36,7 +36,7 @@ export declare const flattenObjectDotNotation: <T extends GenericObjectAny>(obje
|
|
|
36
36
|
* @param updatedObject The modified object containing potential updates.
|
|
37
37
|
* @returns A new object containing only the changed fields.
|
|
38
38
|
*/
|
|
39
|
-
export declare const extractUpdatedFields: <T extends
|
|
39
|
+
export declare const extractUpdatedFields: <T extends GenericObject>(baseObject: T | Partial<T>, updatedObject: Partial<T>) => Partial<T>;
|
|
40
40
|
/**
|
|
41
41
|
* * Extracts only new fields that exist in updatedObject but not in baseObject.
|
|
42
42
|
*
|
|
@@ -44,7 +44,7 @@ export declare const extractUpdatedFields: <T extends GenericObjectAny>(baseObje
|
|
|
44
44
|
* @param updatedObject The modified object containing potential new fields.
|
|
45
45
|
* @returns A new object containing only the new fields.
|
|
46
46
|
*/
|
|
47
|
-
export declare const extractNewFields: <T extends
|
|
47
|
+
export declare const extractNewFields: <T extends GenericObject, U extends GenericObject>(baseObject: T | Partial<T>, updatedObject: Partial<T> & Partial<U>) => Partial<U>;
|
|
48
48
|
/**
|
|
49
49
|
* * Extracts changed fields from the updated object while also identifying newly added keys.
|
|
50
50
|
*
|
|
@@ -52,5 +52,5 @@ export declare const extractNewFields: <T extends GenericObjectAny, U extends Ge
|
|
|
52
52
|
* @param updatedObject The modified object containing potential updates.
|
|
53
53
|
* @returns An object containing modified fields and new fields separately.
|
|
54
54
|
*/
|
|
55
|
-
export declare const extractUpdatedAndNewFields: <T extends
|
|
55
|
+
export declare const extractUpdatedAndNewFields: <T extends GenericObject, U extends GenericObject>(baseObject: T | Partial<T>, updatedObject: Partial<T> & Partial<U>) => Partial<T> & Partial<U>;
|
|
56
56
|
//# sourceMappingURL=objectify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectify.d.ts","sourceRoot":"","sources":["../../src/object/objectify.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"objectify.d.ts","sourceRoot":"","sources":["../../src/object/objectify.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,aAAa,cAAc,CAAC,EAAE,KAAG,CAuCvE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,GAAI,CAAC,SAAS,aAAa,cACjD,CAAC,EAAE,KACb,aAyBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,aAAa,UACpD,CAAC,KACP,CAmBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,CAAC,SAAS,aAAa,UACvD,CAAC,KACP,aAkCF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,aAAa,cAC/C,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,iBACX,OAAO,CAAC,CAAC,CAAC,KACvB,OAAO,CAAC,CAAC,CAwBX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAC5B,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,aAAa,cAEX,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,iBACX,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KACpC,OAAO,CAAC,CAAC,CAsBX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACtC,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,aAAa,cAEX,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,iBACX,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,KACpC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAwBxB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GenericObject, SanitizedData, SanitizeOptions } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* * Sanitizes an object by ignoring specified keys and trimming string values based on options provided.
|
|
4
4
|
* * Also excludes nullish values (null, undefined) if specified. Always ignores empty nested object(s).
|
|
@@ -7,7 +7,7 @@ import type { GenericObjectAny, SanitizedData, SanitizeOptions } from './types';
|
|
|
7
7
|
* @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish values.
|
|
8
8
|
* @returns A new object with the specified modifications.
|
|
9
9
|
*/
|
|
10
|
-
export declare function sanitizeData<T extends
|
|
10
|
+
export declare function sanitizeData<T extends GenericObject>(object: T, options?: SanitizeOptions<T>): SanitizedData<T>;
|
|
11
11
|
/**
|
|
12
12
|
* * Sanitizes an array of objects by ignoring specified keys and trimming string values based on options provided.
|
|
13
13
|
* * Also excludes nullish values (null, undefined) if specified. Always ignores empty nested object(s).
|
|
@@ -16,7 +16,7 @@ export declare function sanitizeData<T extends GenericObjectAny>(object: T, opti
|
|
|
16
16
|
* @param options - Options that define which keys to ignore, whether to trim string values, and whether to exclude nullish values.
|
|
17
17
|
* @returns A new array of objects with the specified modifications.
|
|
18
18
|
*/
|
|
19
|
-
export declare function sanitizeData<T extends
|
|
19
|
+
export declare function sanitizeData<T extends GenericObject>(array: T[], options?: SanitizeOptions<T>): SanitizedData<T>[];
|
|
20
20
|
/**
|
|
21
21
|
* * Trims all the words in a string.
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/object/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,
|
|
1
|
+
{"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/object/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEX,aAAa,EACb,aAAa,EACb,eAAe,EACf,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,aAAa,CAAC,CAAC,CAAC,CAAC;AAEpB;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EACnD,KAAK,EAAE,CAAC,EAAE,EACV,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AAEtB;;;;;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"}
|
package/dist/object/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Primitive } from '../types';
|
|
|
2
2
|
/** - Generic object with `unknown` value */
|
|
3
3
|
export type GenericObjectStrict = Record<string, unknown>;
|
|
4
4
|
/** - Generic object but with `any` value */
|
|
5
|
-
export type
|
|
5
|
+
export type GenericObject = Record<string, any>;
|
|
6
6
|
/**
|
|
7
7
|
* * Represents a value that can be used in a query object.
|
|
8
8
|
* - Can be a primitive, an array of primitives, or a nested query object.
|
|
@@ -22,17 +22,17 @@ export type DotNotationKeyStrict<T> = T extends GenericObjectStrict ? {
|
|
|
22
22
|
[K in keyof T & string]: T[K] extends GenericObjectStrict ? `${K}` | `${K}.${DotNotationKeyStrict<T[K]>}` : `${K}`;
|
|
23
23
|
}[keyof T & string] : never;
|
|
24
24
|
/** - Dot-notation keys for nested objects */
|
|
25
|
-
export type
|
|
26
|
-
[K in keyof T & string]: T[K] extends
|
|
25
|
+
export type DotNotationKey<T> = T extends GenericObject ? {
|
|
26
|
+
[K in keyof T & string]: T[K] extends GenericObject ? `${K}` | `${K}.${DotNotationKey<T[K]>}` : `${K}`;
|
|
27
27
|
}[keyof T & string] : never;
|
|
28
28
|
/** - Extract only primitive keys from an object, including nested dot-notation keys. */
|
|
29
|
-
export type NestedPrimitiveKey<T> = T extends
|
|
30
|
-
[K in keyof T & string]: T[K] extends Primitive ? K : T[K] extends
|
|
29
|
+
export type NestedPrimitiveKey<T> = T extends GenericObject ? {
|
|
30
|
+
[K in keyof T & string]: T[K] extends Primitive ? K : T[K] extends GenericObject ? `${K}.${NestedPrimitiveKey<T[K]>}` : never;
|
|
31
31
|
}[keyof T & string] : never;
|
|
32
32
|
/** - Options for `sanitizeData` */
|
|
33
|
-
export interface SanitizeOptions<T extends
|
|
33
|
+
export interface SanitizeOptions<T extends GenericObject> {
|
|
34
34
|
/** Keys to ignore */
|
|
35
|
-
keysToIgnore?:
|
|
35
|
+
keysToIgnore?: DotNotationKey<T>[];
|
|
36
36
|
/** Whether to trim string values. Defaults to `true` */
|
|
37
37
|
trimStrings?: boolean;
|
|
38
38
|
/** Whether to exclude nullish (null or undefined) values. Defaults to `false` */
|
|
@@ -40,7 +40,7 @@ export interface SanitizeOptions<T extends GenericObjectAny> {
|
|
|
40
40
|
}
|
|
41
41
|
/** - Data after sanitization. */
|
|
42
42
|
export type SanitizedData<T> = {
|
|
43
|
-
[P in keyof T]?: T[P] extends
|
|
43
|
+
[P in keyof T]?: T[P] extends GenericObject ? SanitizedData<T[P]> : T[P];
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* - Dot-notation keys for nested objects.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/object/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,4CAA4C;AAC5C,MAAM,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,CAAC,CAAC,GAC1B,MAAM;CACR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAElE;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAG,OA6B3C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAC9B,CAAC,EAAE,cACC,MAAM,KACf,MAKF,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,SAAS,YACvC,CAAC,qBAET,SAAS,CAAC,CAAC,CAYb,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,SAAS,SAAS,YACvC,CAAC,qBAET,WAAW,CAAC,CAAC,CAWf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nhb-toolbox",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.8",
|
|
4
4
|
"description": "A versatile collection of smart, efficient, and reusable utility functions for everyday development needs.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -53,10 +53,11 @@
|
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|
|
55
55
|
"clean": "rimraf dist",
|
|
56
|
-
"build": "node build.mjs",
|
|
56
|
+
"build": "node scripts/build.mjs",
|
|
57
57
|
"test": "jest --coverage --verbose",
|
|
58
58
|
"format": "prettier --write src/",
|
|
59
|
-
"lint": "node
|
|
60
|
-
"fix": "node fix.mjs"
|
|
59
|
+
"lint": "node scripts/.mjs",
|
|
60
|
+
"fix": "node scripts/fix.mjs",
|
|
61
|
+
"bump": "node scripts/bump.mjs"
|
|
61
62
|
}
|
|
62
63
|
}
|