- Add snake-case.ts: objectToSnakeCase, objectToCamelCase utilities - Add tool-name.ts: transformToolName with PascalCase conversion - Add pattern-matcher.ts: findMatchingHooks for hook config matching - Add hook-disabled.ts: isHookDisabled for hook config validation - Add temporary stub types at src/hooks/claude-code-hooks/types.ts - Export all new utilities from src/shared/index.ts Stub types will be replaced with full implementation in Task 1. Import paths adjusted from opencode-cc-plugin structure to oh-my-opencode. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
23 lines
436 B
TypeScript
23 lines
436 B
TypeScript
import type { ClaudeHookEvent, PluginConfig } from "../hooks/claude-code-hooks/types"
|
|
|
|
export function isHookDisabled(
|
|
config: PluginConfig,
|
|
hookType: ClaudeHookEvent
|
|
): boolean {
|
|
const { disabledHooks } = config
|
|
|
|
if (disabledHooks === undefined) {
|
|
return false
|
|
}
|
|
|
|
if (disabledHooks === true) {
|
|
return true
|
|
}
|
|
|
|
if (Array.isArray(disabledHooks)) {
|
|
return disabledHooks.includes(hookType)
|
|
}
|
|
|
|
return false
|
|
}
|