MCPcopy Create free account
hub / github.com/codebymitch/TitanBot / normalizeCounter

Function normalizeCounter

src/services/serverstatsService.js:94–109  ·  view source on GitHub ↗
(counter, guildId)

Source from the content-addressed store, hash-verified

92}
93
94function normalizeCounter(counter, guildId) {
95 const normalized = {
96 id: String(counter.id),
97 type: String(counter.type),
98 channelId: String(counter.channelId),
99 guildId: String(counter.guildId || guildId),
100 createdAt: counter.createdAt || new Date().toISOString(),
101 enabled: typeof counter.enabled === 'boolean' ? counter.enabled : true
102 };
103
104 if (counter.updatedAt) {
105 normalized.updatedAt = counter.updatedAt;
106 }
107
108 return normalized;
109}
110
111function sanitizeCounters(counters, guildId) {
112 if (!Array.isArray(counters)) {

Callers 1

sanitizeCountersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected