Skip to content

Commit 2e1d3e8

Browse files
refactor: remove string casting of strings
1 parent a75e449 commit 2e1d3e8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/composables/usePackageSelection.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export function usePackageSelection() {
1111
if (!raw) return []
1212
return raw
1313
.split(',')
14-
.map(p => String(p).trim())
14+
.map(p => p.trim())
1515
.filter(Boolean)
1616
.slice(0, MAX_PACKAGE_SELECTION)
1717
},
1818
set(pkgs: string[]) {
1919
// Ensure all items are strings before joining
20-
const validPkgs = (Array.isArray(pkgs) ? pkgs : []).map(p => String(p).trim()).filter(Boolean)
20+
const validPkgs = (Array.isArray(pkgs) ? pkgs : []).map(p => p.trim()).filter(Boolean)
2121
selectedPackagesParam.value = validPkgs.length > 0 ? validPkgs.join(',') : ''
2222
},
2323
})
@@ -38,11 +38,11 @@ export function usePackageSelection() {
3838
}
3939

4040
function isPackageSelected(packageName: string): boolean {
41-
return selectedPackages.value.includes(String(packageName).trim())
41+
return selectedPackages.value.includes(packageName.trim())
4242
}
4343

4444
function togglePackageSelection(packageName: string) {
45-
const safeName = String(packageName).trim()
45+
const safeName = packageName.trim()
4646
if (!safeName) return
4747

4848
const pkgs = [...selectedPackages.value]

0 commit comments

Comments
 (0)