vtex-home-page-sabrina-miranda/dev/vtexEngine/utils.js
2022-12-05 09:22:58 -04:00

18 lines
351 B
JavaScript

module.exports = {
regexFindAll(re, string) {
let regexResult = [];
while ((match = re.exec(string)) != null) {
regexResult.push(match);
}
return regexResult;
},
findInArray(lista, name) {
for (let i = 0; i < lista.length; i++) {
if (lista[i].name == name.trim().toLowerCase()) {
return lista[i];
}
}
return null;
},
};