(slug: string, customModes?: ModeConfig[])
| 49 | |
| 50 | // Helper functions |
| 51 | export function getModeBySlug(slug: string, customModes?: ModeConfig[]): ModeConfig | undefined { |
| 52 | // Check custom modes first |
| 53 | const customMode = customModes?.find((mode) => mode.slug === slug) |
| 54 | if (customMode) { |
| 55 | return customMode |
| 56 | } |
| 57 | // Then check built-in modes |
| 58 | return modes.find((mode) => mode.slug === slug) |
| 59 | } |
| 60 | |
| 61 | export function getModeConfig(slug: string, customModes?: ModeConfig[]): ModeConfig { |
| 62 | const mode = getModeBySlug(slug, customModes) |
no outgoing calls
no test coverage detected