Move persona functions from script. Clean-up exports

This commit is contained in:
Cohee
2024-05-01 14:03:24 +03:00
parent a5475e7752
commit 620cd6dfc2
4 changed files with 429 additions and 542 deletions

View File

@ -1443,8 +1443,8 @@ export function includesIgnoreCaseAndAccents(text, searchTerm) {
if (!text || !searchTerm) return false; // Return false if either string is empty
// Normalize and remove diacritics, then convert to lower case
const normalizedText = text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
const normalizedSearchTerm = searchTerm.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
const normalizedText = text.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase();
const normalizedSearchTerm = searchTerm.normalize('NFD').replace(/[\u0300-\u036f]/g, '').toLowerCase();
// Check if the normalized text includes the normalized search term
return normalizedText.includes(normalizedSearchTerm);