fix: add non-null assertions to skillConfiguration utilities

Add ! non-null assertion operator to target.basic,
target.advanced, and target.expert property accesses.

These objects are conditionally created earlier in the
function and are guaranteed to exist when accessed. The
assertions inform TypeScript of this runtime guarantee.

Fixes 9 TS18046 errors in skillConfiguration.ts.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock
2025-10-07 15:38:59 -05:00
parent 5310463bec
commit 9c71092278

View File

@@ -123,11 +123,11 @@ export function skillConfigurationToSkillSets(config: SkillConfiguration): {
}
if (mode === 'target') {
if (!target.basic) target.basic = {} as any
target.basic[skill as keyof typeof required.basic] = true
target.basic![skill as keyof typeof required.basic] = true
}
if (mode === 'forbidden') {
if (!forbidden.basic) forbidden.basic = {} as any
forbidden.basic[skill as keyof typeof required.basic] = true
forbidden.basic![skill as keyof typeof required.basic] = true
}
})
@@ -138,11 +138,11 @@ export function skillConfigurationToSkillSets(config: SkillConfiguration): {
}
if (mode === 'target') {
if (!target.fiveComplements) target.fiveComplements = {} as any
target.fiveComplements[skill as keyof typeof required.fiveComplements] = true
target.fiveComplements![skill as keyof typeof required.fiveComplements] = true
}
if (mode === 'forbidden') {
if (!forbidden.fiveComplements) forbidden.fiveComplements = {} as any
forbidden.fiveComplements[skill as keyof typeof required.fiveComplements] = true
forbidden.fiveComplements![skill as keyof typeof required.fiveComplements] = true
}
})
@@ -153,11 +153,11 @@ export function skillConfigurationToSkillSets(config: SkillConfiguration): {
}
if (mode === 'target') {
if (!target.tenComplements) target.tenComplements = {} as any
target.tenComplements[skill as keyof typeof required.tenComplements] = true
target.tenComplements![skill as keyof typeof required.tenComplements] = true
}
if (mode === 'forbidden') {
if (!forbidden.tenComplements) forbidden.tenComplements = {} as any
forbidden.tenComplements[skill as keyof typeof required.tenComplements] = true
forbidden.tenComplements![skill as keyof typeof required.tenComplements] = true
}
})