fix(icons): narrow ICON_MAP lookup type for strict build
tsc -b (used in npm run build) flagged TS2774 because LucideIcon is a function and therefore always truthy. Cast the lookup result to LucideIcon | undefined so the falsy branch becomes meaningful.
This commit is contained in:
@@ -218,6 +218,6 @@ export function resolveCustomIcon(customIconKey?: string): ResolvedIcon | null {
|
|||||||
const slug = brandIconSlug(customIconKey)
|
const slug = brandIconSlug(customIconKey)
|
||||||
return { kind: 'brand', slug, url: brandIconUrl(slug) }
|
return { kind: 'brand', slug, url: brandIconUrl(slug) }
|
||||||
}
|
}
|
||||||
const icon = ICON_MAP[customIconKey]
|
const icon = ICON_MAP[customIconKey] as LucideIcon | undefined
|
||||||
return icon ? { kind: 'lucide', icon } : null
|
return icon ? { kind: 'lucide', icon } : null
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user