Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the resolveFormId and resolveFormKey helper functions in the Pokemon class to support string-based form proto names (e.g., 'VIKAVOLT_WINTER_2025') in addition to numeric form IDs when processing PokeAPI evolution data.
- Expands type signature to accept
number | string | nullinstead of justnumber | null - Adds string-to-numeric form ID conversion using
Rpc.PokemonDisplayProto.Formlookup - Improves data generation flexibility by handling both numeric and proto name inputs
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (typeof value === 'string') { | ||
| const numeric = Rpc.PokemonDisplayProto.Form[ | ||
| value as FormProto | ||
| ] | ||
| return numeric !== undefined | ||
| ? numeric | ||
| : defaultFormId !== undefined | ||
| ? defaultFormId | ||
| : undefined | ||
| } |
There was a problem hiding this comment.
When a string formId is provided but cannot be found in Rpc.PokemonDisplayProto.Form, the function silently falls back to defaultFormId or undefined without any warning. This could mask data issues where an invalid or misspelled form proto name is provided. Consider logging a warning when the lookup fails to help with debugging data generation issues.
|
Separate fix WIP. |
@roundaboutluke hopefully this will fix the data generation