aggiornamento cataloghi, search

This commit is contained in:
Surya Paolo
2025-04-22 18:30:48 +02:00
parent ad45ce60ee
commit 58431c144c
9 changed files with 194 additions and 42 deletions

View File

@@ -6242,6 +6242,21 @@ module.exports = {
return { prodInfo: null, aggiornatoimg: false };
},
removeAccents(mystr) {
if (!mystr) return mystr;
const accentsMap = new Map([
['á', 'a'], ['à', 'a'], ['ã', 'a'], ['ä', 'a'], ['â', 'a'],
['é', 'e'], ['è', 'e'], ['ë', 'e'], ['ê', 'e'],
['í', 'i'], ['ì', 'i'], ['ï', 'i'], ['î', 'i'],
['ó', 'o'], ['ò', 'o'], ['ö', 'o'], ['ô', 'o'], ['õ', 'o'],
['ú', 'u'], ['ù', 'u'], ['ü', 'u'], ['û', 'u'],
['ç', 'c'], ['ñ', 'n'],
]);
return Array.from(mystr).map(char => accentsMap.get(char) || char).join('');
},