(config)
| 158 | } |
| 159 | |
| 160 | export 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 | |
| 181 | export function normalizeGuildConfig(raw, defaults = {}) { |
| 182 | const base = typeof raw === 'object' && raw !== null ? raw : {}; |
no outgoing calls
no test coverage detected