From baa3061685c70cf9fa7f797f03d0f6a2f4fe414d Mon Sep 17 00:00:00 2001 From: Pascal Martineau Date: Wed, 21 Jan 2026 21:58:35 -0500 Subject: [PATCH] fix: immutable extractNodes --- wp-content/themes/moonshine/shared/utils/graphql.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/moonshine/shared/utils/graphql.ts b/wp-content/themes/moonshine/shared/utils/graphql.ts index 0c5d1cc..7e8d4d9 100644 --- a/wp-content/themes/moonshine/shared/utils/graphql.ts +++ b/wp-content/themes/moonshine/shared/utils/graphql.ts @@ -1,4 +1,4 @@ // Helper: Extracts nodes from a GraphQL connection object, returning an empty array if nodes are absent. -export function extractNodes(connection: { nodes?: T[] } | null | undefined): T[] { - return connection?.nodes || [] as T[]; +export function extractNodes(connection: { nodes?: readonly T[] } | null | undefined): readonly T[] { + return connection?.nodes ?? []; }