Some checks failed
Test and deploy staging / staging (push) Failing after 5m29s
16 lines
602 B
TypeScript
16 lines
602 B
TypeScript
import images from '../../../../../data/game-images.json';
|
|
import maps from '../../../../../data/pokemon-map-art.json';
|
|
export function load() {
|
|
const sources = new Map<string, { source: string; credit: string; count: number }>();
|
|
for (const image of images) {
|
|
const existing = sources.get(image.source);
|
|
if (existing) existing.count++;
|
|
else sources.set(image.source, { source: image.source, credit: image.credit, count: 1 });
|
|
}
|
|
return {
|
|
sources: [...sources.values()],
|
|
maps: Object.values(maps).map(({ name, source, credit }) => ({ name, source, credit })),
|
|
total: images.length
|
|
};
|
|
}
|