(text)
| 212 | }; |
| 213 | |
| 214 | function getCategoryKeyFromText(text) { |
| 215 | const normalizedText = normalizeText(text); |
| 216 | if (!normalizedText) return ''; |
| 217 | |
| 218 | for (const [key, patterns] of Object.entries(GMAIL_CATEGORY_LABELS)) { |
| 219 | if (patterns.some((pattern) => pattern.test(normalizedText))) { |
| 220 | return key; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | return ''; |
| 225 | } |
| 226 | |
| 227 | function getCategoryTabLabel(tab) { |
| 228 | const text = normalizeText( |
no test coverage detected