feat: 全部类型问题解决

This commit is contained in:
claude-code-best
2026-04-11 10:24:00 +08:00
parent 7088fe3c8b
commit 6a70056910
135 changed files with 671 additions and 503 deletions

View File

@@ -81,6 +81,7 @@ import {
setPluginSettingsBase,
} from '../settings/settingsCache.js'
import type { HooksSettings } from '../settings/types.js'
import type { HookMatcher } from '../../schemas/hooks.js'
import { SettingsSchema } from '../settings/types.js'
import { jsonParse, jsonStringify } from '../slowOperations.js'
import { getAddDirEnabledPlugins } from './addDirPluginSettings.js'
@@ -1861,15 +1862,13 @@ function mergeHooksSettings(
const merged = { ...base }
for (const [event, matchers] of Object.entries(additional)) {
for (const [event, matchers] of Object.entries(additional) as [string, HookMatcher[]][]) {
if (!merged[event as keyof HooksSettings]) {
merged[event as keyof HooksSettings] = matchers
} else {
// Merge matchers for this event
merged[event as keyof HooksSettings] = [
...(merged[event as keyof HooksSettings] || []),
...matchers,
]
const existing = ((merged[event as keyof HooksSettings] as unknown) ?? []) as HookMatcher[]
merged[event as keyof HooksSettings] = [...existing, ...matchers]
}
}