Skip to content

Commit

Permalink
chore: use Keys type and remove duplicated type def
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-sanderson committed Dec 3, 2024
1 parent ab145cb commit ff38635
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/utils/src/mergeDeepObject.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
// code shamelessly stolen from https://github.com/voodoocreation/ts-deepmerge

type TAllKeys<T> = T extends any ? keyof T : never;
import { Keys } from '@trezor/type-utils';

type TIndexValue<T, K extends PropertyKey, D = never> = T extends any
? K extends keyof T
Expand All @@ -22,7 +22,7 @@ type TMerged<T> = [T] extends [Array<any>]
: [T] extends [TPrimitives]
? T
: [T] extends [object]
? TPartialKeys<{ [K in TAllKeys<T>]: TMerged<TIndexValue<T, K>> }, never>
? TPartialKeys<{ [K in Keys<T>]: TMerged<TIndexValue<T, K>> }, never>
: T;

// istanbul ignore next
Expand Down

0 comments on commit ff38635

Please sign in to comment.