fix: resolve string undefined assignment errors

- Fix jobUtils proficiency type narrowing by storing intermediate values
- Add default empty string for openDescriptionSidebar title parameter
- Remove explicit undefined assignments in search resource tests

Reduces errors from 68 to 63.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Justin Edmund 2025-11-28 18:44:20 -08:00
parent a74653ee93
commit 84be6ea30f
3 changed files with 9 additions and 9 deletions

View file

@ -176,14 +176,12 @@ describe('SearchResource', () => {
// Set some mock data // Set some mock data
resource.weapons = { resource.weapons = {
loading: false, loading: false,
data: { results: [] }, data: { results: [] }
error: undefined
} }
resource.characters = { resource.characters = {
loading: false, loading: false,
data: { results: [] }, data: { results: [] }
error: undefined
} }
// Clear weapons only // Clear weapons only

View file

@ -12,7 +12,7 @@ export function openDescriptionSidebar(options: DescriptionSidebarOptions) {
const { title, description, canEdit = false, onEdit } = options const { title, description, canEdit = false, onEdit } = options
// Open the sidebar with the party title as the header // Open the sidebar with the party title as the header
sidebar.openWithComponent(title, DescriptionSidebar, { sidebar.openWithComponent(title ?? '', DescriptionSidebar, {
title, title,
description, description,
canEdit, canEdit,

View file

@ -190,11 +190,13 @@ export function formatJobProficiency(proficiency: [number, number]): string[] {
} }
const result: string[] = [] const result: string[] = []
if (proficiency[0] && weaponTypes[proficiency[0]]) { const type1 = proficiency[0] ? weaponTypes[proficiency[0]] : undefined
result.push(weaponTypes[proficiency[0]]) if (type1) {
result.push(type1)
} }
if (proficiency[1] && weaponTypes[proficiency[1]]) { const type2 = proficiency[1] ? weaponTypes[proficiency[1]] : undefined
result.push(weaponTypes[proficiency[1]]) if (type2) {
result.push(type2)
} }
return result return result