refactor(desktop): organize lib modules by domain
This commit is contained in:
1 parent
90f0594e93
commit
7e7c4944e9
700 files changed
+1292
-1264
No files matched your search
@@ -0,0 +1,10 @@
|
||||
export function filterDatabaseOptions(options: string[], query: string, displayName: (option: string) => string = (option) => option): string[] {
|
||||
const normalizedQuery = query.trim().toLowerCase();
|
||||
if (!normalizedQuery) return options;
|
||||
|
||||
return options.filter((option) => {
|
||||
const raw = option.toLowerCase();
|
||||
const label = displayName(option).toLowerCase();
|
||||
return raw.includes(normalizedQuery) || label.includes(normalizedQuery);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user