diff --git a/types/shared.d.ts b/types/shared.d.ts index b0f9bbd5..28bb81a0 100644 --- a/types/shared.d.ts +++ b/types/shared.d.ts @@ -5,13 +5,18 @@ export type { DefaultTheme } from './default-theme.js' export type Awaitable = T | PromiseLike -// Beware that this may cause performance issues or infinite loops -// Use only when absolutely necessary -export type DeepPartial = T extends object - ? { - [K in keyof T]?: DeepPartial - } - : T +type DeepPartial = + T extends Record + ? T extends + | Date + | RegExp + | Function + | ReadonlyMap + | ReadonlySet + | ReadonlyArray + ? T + : { [P in keyof T]?: DeepPartial } + : T export interface PageData { relativePath: string