MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / normalizeToggleRecord

Function normalizeToggleRecord

src/services/commandAccessService.js:11–27  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

9} from '../config/commandCategories.js';
10
11function 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
29export function buildCommandRegistry(client) {
30 const categories = new Map();

Callers 7

isCommandEnabledInConfigFunction · 0.85
getCommandAccessSnapshotFunction · 0.85
disableCommandFunction · 0.85
enableCommandFunction · 0.85
disableCategoryFunction · 0.85
enableCategoryFunction · 0.85
resetCategoryCommandsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected