mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-17 10:53:57 +01:00
feat: migrated tankopedia search
This commit is contained in:
1 parent
73c7bdf0c0
commit
e1c8194beb
59 files changed
+146
-131
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { deburr } from 'lodash';
|
||||
import { camouflageDefinitions, tankDefinitionsArray } from '.';
|
||||
|
||||
export const tankNames = Promise.all([
|
||||
tankDefinitionsArray,
|
||||
camouflageDefinitions,
|
||||
]).then(([tanks, camouflages]) =>
|
||||
Promise.all(
|
||||
tanks.map(async (tank, index) => {
|
||||
const { id } = (await tankDefinitionsArray)[index];
|
||||
|
||||
return {
|
||||
id,
|
||||
name: tank.name,
|
||||
nameFull: tank.nameFull,
|
||||
searchableName: tank.nameFull ?? tank.name,
|
||||
searchableNameDeburr: deburr(tank.nameFull ?? tank.name),
|
||||
camouflages: tank.camouflages
|
||||
?.map((id) => camouflages[id].name)
|
||||
.join(' '),
|
||||
treeType: tank.treeType,
|
||||
};
|
||||
}),
|
||||
),
|
||||
);
|
||||
Reference in new issue
Block a user