@win2win/shared 1.0.145 → 1.0.147
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.
|
@@ -17,4 +17,4 @@ export declare function toCurrency(value: number, symbol?: string, options?: {
|
|
|
17
17
|
* @param options.emptyValues - Array of values that should be ignored when merging objects (default: `undefined`)
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
|
-
export declare function mergeObjects(...args: Record<string, any>[]): Record<string, any>;
|
|
20
|
+
export declare function mergeObjects<T extends Record<string, any>>(...args: Record<string, any>[]): Record<string, any>;
|
|
@@ -74,7 +74,7 @@ function mergeObjects(...args) {
|
|
|
74
74
|
: undefined;
|
|
75
75
|
const emptyValues = [undefined, ...(options?.emptyValues || [])];
|
|
76
76
|
return args.reduce((acc, obj) => {
|
|
77
|
-
return (0, lodash_1.mergeWith)(acc, obj, (objValue, srcValue) => {
|
|
77
|
+
return (0, lodash_1.mergeWith)(acc, obj || {}, (objValue, srcValue) => {
|
|
78
78
|
if (emptyValues.some((v) => srcValue === v))
|
|
79
79
|
return objValue;
|
|
80
80
|
return srcValue;
|
package/package.json
CHANGED