From a8e1c0a7402940e0fc5beef669522b315052df1b Mon Sep 17 00:00:00 2001 From: Florian Lefebvre Date: Thu, 5 Jun 2025 16:24:33 +0200 Subject: chore: clean db specific code (#13893) --- packages/astro/src/core/config/merge.ts | 10 +--------- packages/astro/src/types/public/config.ts | 11 ----------- 2 files changed, 1 insertion(+), 20 deletions(-) (limited to 'packages') diff --git a/packages/astro/src/core/config/merge.ts b/packages/astro/src/core/config/merge.ts index 1414f82f3..2344b0f8e 100644 --- a/packages/astro/src/core/config/merge.ts +++ b/packages/astro/src/core/config/merge.ts @@ -15,7 +15,7 @@ function mergeConfigRecursively( continue; } - let existing = merged[key]; + const existing = merged[key]; if (existing == null) { merged[key] = value; @@ -45,14 +45,6 @@ function mergeConfigRecursively( continue; } - if (key === 'data' && rootPath === 'db') { - // db.data can be a function or an array of functions. When - // merging, make sure they become an array - if (!Array.isArray(existing) && !Array.isArray(value)) { - existing = [existing]; - } - } - if (Array.isArray(existing) || Array.isArray(value)) { merged[key] = [...arraify(existing ?? []), ...arraify(value ?? [])]; continue; diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts index 94a5a6e56..b1bfbbe22 100644 --- a/packages/astro/src/types/public/config.ts +++ b/packages/astro/src/types/public/config.ts @@ -1858,9 +1858,6 @@ export interface ViteUserConfig extends OriginalViteUserConfig { : Partial>, string>>; }; - /** ! WARNING: SUBJECT TO CHANGE */ - db?: Config.Database; - /** * @docs * @kind heading @@ -2587,11 +2584,3 @@ export interface AstroInlineOnlyConfig { */ logger?: Logger; } - -// HACK! astro:db augment this type that is used in the config -declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace - namespace Config { - type Database = Record; - } -} -- cgit v1.2.3