From f083497e869864ac1ed041f0e5e5a8c56e27e0f4 Mon Sep 17 00:00:00 2001 From: Jenny Date: Wed, 2 Oct 2024 11:37:37 +0200 Subject: [PATCH] Revert normalizeValue change --- .../utils/es_fields_mappings/es_fields_mappings_helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/apm/server/utils/es_fields_mappings/es_fields_mappings_helpers.ts b/x-pack/plugins/observability_solution/apm/server/utils/es_fields_mappings/es_fields_mappings_helpers.ts index 60899c852ff53..1dc5d57dceb94 100644 --- a/x-pack/plugins/observability_solution/apm/server/utils/es_fields_mappings/es_fields_mappings_helpers.ts +++ b/x-pack/plugins/observability_solution/apm/server/utils/es_fields_mappings/es_fields_mappings_helpers.ts @@ -7,7 +7,7 @@ import type { Fields } from './types'; export const normalizeValue = (field: unknown[] | unknown): T => { - return (Array.isArray(field) && field.length === 1 ? field[0] : field) as T; + return (Array.isArray(field) && field.length > 0 ? field[0] : field) as T; }; export const isOptionalFieldDefined = (fields: Fields, fieldToCheck: string): boolean =>