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
resource.weapons = {
loading: false,
data: { results: [] },
error: undefined
data: { results: [] }
}
resource.characters = {
loading: false,
data: { results: [] },
error: undefined
data: { results: [] }
}
// Clear weapons only

View file

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

View file

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