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.
This commit is contained in:
Johnpaul
2026-01-26 01:45:05 +01:00
parent 154e631848
commit 8a447b5690

View File

@@ -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
}