Skip to content

Commit ee9e572

Browse files
committed
no need to export deep partial and use Record<string, unknown> instead of object because object matches date, regexp, function, array, set, map which we don't handle
1 parent 01f600f commit ee9e572

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

types/shared.d.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@ export type { DefaultTheme } from './default-theme.js'
55

66
export type Awaitable<T> = T | PromiseLike<T>
77

8-
// Beware that this may cause performance issues or infinite loops
9-
// Use only when absolutely necessary
10-
export type DeepPartial<T> = T extends object
11-
? {
12-
[K in keyof T]?: DeepPartial<T[K]>
13-
}
14-
: T
8+
type DeepPartial<T> =
9+
T extends Record<string, unknown> ? { [P in keyof T]?: DeepPartial<T[P]> } : T
1510

1611
export interface PageData {
1712
relativePath: string

0 commit comments

Comments
 (0)