mirror of
https://github.com/smogon/sprites.git
synced 2026-09-12 03:55:47 -05:00
data: don't expose Map directly
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user