Skip to content

Instantly share code, notes, and snippets.

@BrunoGiubilei
Created November 22, 2019 11:28
Show Gist options
  • Save BrunoGiubilei/0bb0d248c0df761a114124cd306a20a0 to your computer and use it in GitHub Desktop.
Save BrunoGiubilei/0bb0d248c0df761a114124cd306a20a0 to your computer and use it in GitHub Desktop.
Filtrar dentro de um array de objetos por qualquer termo em qualquer propriedade
items.filter(function(reg) {
return Object.values(reg).find(function(prop) {
return prop !== null && prop.toString().normalize('NFD').replace(/[\u0300-\u036f]/g, "").toUpperCase().indexOf(query.toUpperCase()) >= 0;
}) !== undefined;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment