From 0dc2a0a570807829d5ce71014ab125f8040c4dd2 Mon Sep 17 00:00:00 2001 From: BarnacleBoy Date: Mon, 18 May 2026 13:08:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20drupal-meta=20=E2=80=94=20Array.isArray?= =?UTF-8?q?=20narrowing=20for=20custom=20tags=20union=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/vdn-static/src/utils/drupal-meta.ts | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/apps/vdn-static/src/utils/drupal-meta.ts b/apps/vdn-static/src/utils/drupal-meta.ts index 9078f38..1475417 100644 --- a/apps/vdn-static/src/utils/drupal-meta.ts +++ b/apps/vdn-static/src/utils/drupal-meta.ts @@ -60,19 +60,21 @@ export function generateDrupalNodeMeta( } // Add sticky/promote as robots meta - if (attributes.sticky || attributes.promote) { - meta.custom?.push({ - name: 'robots', - content: 'index, follow', - }) - } + if (meta.custom && Array.isArray(meta.custom)) { + if (attributes.sticky || attributes.promote) { + meta.custom.push({ + name: 'robots', + content: 'index, follow', + }) + } - // Add status-based robots meta - if (!attributes.status) { - meta.custom?.push({ - name: 'robots', - content: 'noindex, nofollow', - }) + // Add status-based robots meta + if (!attributes.status) { + meta.custom.push({ + name: 'robots', + content: 'noindex, nofollow', + }) + } } return meta @@ -98,7 +100,7 @@ export function generateArticleContentMeta( type: 'article', }, custom: [ - ...(baseMeta.custom || []), + ...(Array.isArray(baseMeta.custom) ? baseMeta.custom : []), // Article-specific meta tags { property: 'article:section', @@ -151,7 +153,7 @@ export function generateLearningResourceMeta( type: 'article', }, custom: [ - ...(baseMeta.custom || []), + ...(Array.isArray(baseMeta.custom) ? baseMeta.custom : []), // Learning resource-specific meta tags { name: 'resource-type',