mirror of
https://github.com/smogon/sprites.git
synced 2026-03-23 10:25:19 -05:00
28 lines
574 B
TypeScript
28 lines
574 B
TypeScript
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
import fs from 'fs';
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
const libdir = path.join(__dirname, "../..");
|
|
|
|
export type Type = {
|
|
num: number,
|
|
formeNum: number,
|
|
base: string,
|
|
forme: string,
|
|
sid: number
|
|
};
|
|
|
|
const species : Record<number, Type> = JSON.parse(fs.readFileSync(path.join(libdir, "species.json"), 'utf8'));
|
|
|
|
const result = new Map<number, Type>();
|
|
|
|
for (const entry of Object.values(species)) {
|
|
result.set(entry.sid, entry);
|
|
}
|
|
|
|
export default result;
|
|
|