Skip to content

Commit 9a7d8cd

Browse files
[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
1 parent 35f5773 commit 9a7d8cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/dialog/content/manager/PackVersionSelectorPopover.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ const SelectedVersionValues = {
110110
}
111111
112112
const ManagerChannelValues: Record<string, ManagerChannel> = {
113-
DEFAULT: 'default', // ✅ Valid - will compile
114-
DEV: 'dev' // ✅ Valid - will compile
113+
DEFAULT: 'default',
114+
DEV: 'dev'
115115
}
116116
117117
const ManagerDatabaseSourceValues: Record<string, ManagerDatabaseSource> = {

0 commit comments

Comments
 (0)