(raw)
| 9 | } from '../config/commandCategories.js'; |
| 10 | |
| 11 | function normalizeToggleRecord(raw) { |
| 12 | if (!raw) { |
| 13 | return {}; |
| 14 | } |
| 15 | |
| 16 | if (Array.isArray(raw)) { |
| 17 | return Object.fromEntries(raw.map((entry) => [String(entry).toLowerCase(), true])); |
| 18 | } |
| 19 | |
| 20 | if (typeof raw === 'object') { |
| 21 | return Object.fromEntries( |
| 22 | Object.entries(raw).map(([key, value]) => [String(key).toLowerCase(), Boolean(value)]), |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | return {}; |
| 27 | } |
| 28 | |
| 29 | export function buildCommandRegistry(client) { |
| 30 | const categories = new Map(); |
no outgoing calls
no test coverage detected