From 8a447b56902dcca43dbdbd7575a025e4335f764b Mon Sep 17 00:00:00 2001 From: Johnpaul Date: Mon, 26 Jan 2026 01:45:05 +0100 Subject: [PATCH] refactor: simplify type guards in normalizeSurveyResponses Remove redundant 'in' checks from type guards. The typeof check already handles missing properties by returning 'undefined', making the 'in' operator check unnecessary. --- src/platform/telemetry/utils/surveyNormalization.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/telemetry/utils/surveyNormalization.ts b/src/platform/telemetry/utils/surveyNormalization.ts index 61e57954b..ba126f905 100644 --- a/src/platform/telemetry/utils/surveyNormalization.ts +++ b/src/platform/telemetry/utils/surveyNormalization.ts @@ -590,13 +590,13 @@ export function normalizeSurveyResponses( const normalized: SurveyResponsesNormalized = { ...responses } // Normalize industry - if ('industry' in responses && typeof responses.industry === 'string') { + if (typeof responses.industry === 'string') { normalized.industry_normalized = normalizeIndustry(responses.industry) normalized.industry_raw = responses.industry } // Normalize use case - if ('useCase' in responses && typeof responses.useCase === 'string') { + if (typeof responses.useCase === 'string') { normalized.useCase_normalized = normalizeUseCase(responses.useCase) normalized.useCase_raw = responses.useCase }