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

Function stripLegacyLoggingFields

src/utils/schemas.js:160–179  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

158}
159
160export function stripLegacyLoggingFields(config) {
161 if (!config || typeof config !== 'object') {
162 return config;
163 }
164
165 const {
166 logChannelId: _logChannelId,
167 enableLogging: _enableLogging,
168 reportChannelId: _reportChannelId,
169 logIgnore: _logIgnore,
170 ...rest
171 } = config;
172
173 if (rest.logging && typeof rest.logging === 'object') {
174 const { channelId: _channelId, ...loggingRest } = rest.logging;
175 rest.logging = loggingRest;
176 }
177
178 return rest;
179}
180
181export function normalizeGuildConfig(raw, defaults = {}) {
182 const base = typeof raw === 'object' && raw !== null ? raw : {};

Callers 2

normalizeGuildConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected