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:
parent
a74653ee93
commit
84be6ea30f
3 changed files with 9 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue