mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
feat: 全部类型问题解决
This commit is contained in:
@@ -1429,7 +1429,7 @@ export function registerHookCallbacks(
|
||||
if (!STATE.registeredHooks[eventKey]) {
|
||||
STATE.registeredHooks[eventKey] = []
|
||||
}
|
||||
STATE.registeredHooks[eventKey]!.push(...matchers)
|
||||
STATE.registeredHooks[eventKey]!.push(...(matchers ?? []))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1451,7 +1451,7 @@ export function clearRegisteredPluginHooks(): void {
|
||||
const filtered: Partial<Record<HookEvent, RegisteredHookMatcher[]>> = {}
|
||||
for (const [event, matchers] of Object.entries(STATE.registeredHooks)) {
|
||||
// Keep only callback hooks (those without pluginRoot)
|
||||
const callbackHooks = matchers.filter(m => !('pluginRoot' in m))
|
||||
const callbackHooks = (matchers ?? []).filter(m => !('pluginRoot' in m))
|
||||
if (callbackHooks.length > 0) {
|
||||
filtered[event as HookEvent] = callbackHooks
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user