mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 04:10:32 +00:00
14 lines
384 B
TypeScript
14 lines
384 B
TypeScript
// @ts-nocheck
|
|
|
|
// Filters accounts items.
|
|
export const accountPredicate = (query, account, _index, exactMatch) => {
|
|
const normalizedTitle = account.name.toLowerCase();
|
|
const normalizedQuery = query.toLowerCase();
|
|
|
|
if (exactMatch) {
|
|
return normalizedTitle === normalizedQuery;
|
|
} else {
|
|
return `${account.code} ${normalizedTitle}`.indexOf(normalizedQuery) >= 0;
|
|
}
|
|
};
|