Is there a way to simplify the code to avoid repetitive use of lowercase and includes condition for each property?
items() {
return this.table.filter.keyword
? this.dataArray.filter(
item =>
item.nombre.toLowerCase().includes(this.table.filter.keyword) ||
item.paisOrigen
.toLowerCase()
.includes(this.table.filter.keyword) ||
item.ciudad.toLowerCase().includes(this.table.filter.keyword) ||
item.sector.toLowerCase().includes(this.table.filter.keyword) ||
item.contratadorPor
.toLowerCase()
.includes(this.table.filter.keyword) ||
item.moneda.toLowerCase().includes(this.table.filter.keyword)
)
: this.dataArray;
}
Appreciate any help!