feat: perf

This commit is contained in:
TrèsAbhi committed 2024-06-21 14:03:20 -05:00
1 parent df8b32b7cd
commit a57734cdee
6 files changed
+225 -158

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
import { TankopediaFilters } from '../../stores/tankopediaFilters';
import { TankDefinition } from './tankDefinitions';
export function tankopediaFilterTank(
filters: TankopediaFilters,
tank: TankDefinition,
) {
return (
(filters.tier === undefined || filters.tier === tank.tier) &&
(filters.nation === undefined || filters.nation === tank.nation) &&
(filters.class === undefined || filters.class === tank.class) &&
(filters.type === undefined || filters.type === tank.treeType) &&
(filters.testing === 'include' ||
(filters.testing === 'only' && tank.testing) ||
(filters.testing === 'exclude' && !tank.testing))
);
}