From 886be3245ad4bc33f9a965416f23a92d85937b9d Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Sun, 13 Apr 2025 21:22:30 +0530 Subject: [PATCH] no need to export deep partial and exclude non-pure-object stuff --- types/shared.d.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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