refactoring: update severals components
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
const containsAppsMatchingSearch = (values, search) => {
|
||||
if (search.value.trim() === '') {
|
||||
return true
|
||||
}
|
||||
|
||||
for (let key in values) {
|
||||
if (isAppMatchingSearch(values[key].name)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
const isAppMatchingSearch = (item, search) => {
|
||||
if (search.value.trim() === '') {
|
||||
return true
|
||||
}
|
||||
|
||||
return item.name.toLowerCase().includes(search.value.trim().toLowerCase())
|
||||
}
|
||||
|
||||
export {
|
||||
containsAppsMatchingSearch,
|
||||
isAppMatchingSearch,
|
||||
}
|
||||
Reference in New Issue
Block a user