mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 10:00:08 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user