mirror of
https://github.com/smogon/sprites.git
synced 2026-03-21 17:35:13 -05:00
data: don't expose Map directly
This commit is contained in:
parent
1293ff4799
commit
32ba2af711
|
|
@ -21,5 +21,13 @@ for (const entry of Object.values(species)) {
|
|||
result.set(entry.sid, entry);
|
||||
}
|
||||
|
||||
export default result;
|
||||
export function get(id : number) : Type {
|
||||
const entry = result.get(id);
|
||||
if (entry === undefined)
|
||||
throw new Error(`No id for ${id}`);
|
||||
return entry;
|
||||
}
|
||||
|
||||
export function entries() : [number, Type][] {
|
||||
return Array.from(result.entries());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import nodePath from 'path';
|
|||
import vm from 'vm';
|
||||
import * as pathlib from './path.js';
|
||||
import * as spritename from './spritename.js';
|
||||
import spritedata from '@smogon/sprite-data';
|
||||
import * as spritedata from '@smogon/sprite-data';
|
||||
|
||||
type CopyEntry = {
|
||||
type : 'Copy',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user