Skip to content

Commit

Permalink
fix: incorporated review comment
Browse files Browse the repository at this point in the history
  • Loading branch information
likhith-deriv committed Jul 12, 2024
1 parent a099f46 commit 5ff3441
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/object.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const hashObject = async <T extends object>(object: T) => {
return hashedString;
};

type DeepPartial<T> = {
[P in keyof T]?: DeepPartial<T[P]>;
type TSources<T> = {
[P in keyof T]?: TSources<T[P]>;
};

const replaceValue = <T>(value: T, newValue: T): T => {
Expand All @@ -46,7 +46,7 @@ const replaceValue = <T>(value: T, newValue: T): T => {
* @param sources - The objects to merge into target
* @returns The merged object
*/
export const merge = <T>(target: T, ...sources: DeepPartial<T>[]): T => {
export const merge = <T>(target: T, ...sources: TSources<T>[]): T => {
for (const source of sources) {
for (const key in source) {
if (source[key] === null || source[key] === undefined) {
Expand Down

0 comments on commit 5ff3441

Please sign in to comment.