(fields = [])
| 46 | } |
| 47 | |
| 48 | export function splitComparisonFields(fields = []) { |
| 49 | const comparison = { before: null, after: null, rest: [] }; |
| 50 | |
| 51 | for (const field of fields) { |
| 52 | const label = stripFieldLabel(field.name).toLowerCase(); |
| 53 | |
| 54 | if (/^old|^before/.test(label)) { |
| 55 | comparison.before = field.value; |
| 56 | } else if (/^new|^after/.test(label)) { |
| 57 | comparison.after = field.value; |
| 58 | } else { |
| 59 | comparison.rest.push(field); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | return comparison; |
| 64 | } |
| 65 | |
| 66 | export function applyLogFooter(embed, { guild, executorId, executorTag, executorAvatar, footerText } = {}) { |
| 67 | if (footerText) { |
no test coverage detected