mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
[refactor] Enforce enum type safety by removing type assertions (#5315)
Remove type assertions (as ManagerChannel) that bypass TypeScript's type checking and replace with explicit Record typing. This ensures invalid enum values are caught at compile time rather than runtime. - Replace type assertions with Record<string, ManagerChannel> typing - Remove manual casting that bypassed TypeScript validation - Ensure enum values are validated during compilation
This commit is contained in:
@@ -110,8 +110,8 @@ const SelectedVersionValues = {
|
||||
}
|
||||
|
||||
const ManagerChannelValues: Record<string, ManagerChannel> = {
|
||||
DEFAULT: 'default', // ✅ Valid - will compile
|
||||
DEV: 'dev' // ✅ Valid - will compile
|
||||
DEFAULT: 'default',
|
||||
DEV: 'dev'
|
||||
}
|
||||
|
||||
const ManagerDatabaseSourceValues: Record<string, ManagerDatabaseSource> = {
|
||||
|
||||
Reference in New Issue
Block a user