mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: full name search
This commit is contained in:
1 parent
638c2c73da
commit
c04192e15e
4 files changed
+13
-15
No files matched your search
@@ -86,21 +86,15 @@ export const tanksDefinitionsArray = new Promise<TankDefinition[]>(
|
||||
resolve((await entries).map((entry) => entry));
|
||||
},
|
||||
);
|
||||
export const tankNames = new Promise<string[]>(async (resolve) => {
|
||||
resolve((await entries).map(({ name }) => name));
|
||||
});
|
||||
export const tankNamesDiacritics = tankNames.then((tankNames) =>
|
||||
export const tankNames = tanksDefinitionsArray.then((tanks) =>
|
||||
Promise.all(
|
||||
tankNames.map(async (tankName, index) => {
|
||||
tanks.map(async (tank, index) => {
|
||||
const { id } = (await tanksDefinitionsArray)[index];
|
||||
const name = tankName ?? `Unknown Tank ${id}`;
|
||||
const diacriticless = deburr(name);
|
||||
|
||||
return {
|
||||
original: name,
|
||||
diacriticless,
|
||||
combined: `${name}${diacriticless}`,
|
||||
id,
|
||||
original: tank.name,
|
||||
combined: `${tank.name}${deburr(tank.name)}${tank.name_full ? `${tank.name_full}${deburr(tank.name_full)}` : ''}`,
|
||||
};
|
||||
}),
|
||||
),
|
||||
|
||||
Reference in new issue
Block a user