Skip to content

fix: pokeapi evo form#120

Closed
Fabio1988 wants to merge 1 commit intomainfrom
fix-pokeapi-evo-forms
Closed

fix: pokeapi evo form#120
Fabio1988 wants to merge 1 commit intomainfrom
fix-pokeapi-evo-forms

Conversation

@Fabio1988
Copy link
Collaborator

@roundaboutluke hopefully this will fix the data generation

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | null instead of just number | null
  • Adds string-to-numeric form ID conversion using Rpc.PokemonDisplayProto.Form lookup
  • 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.

Comment on lines +1028 to +1037
if (typeof value === 'string') {
const numeric = Rpc.PokemonDisplayProto.Form[
value as FormProto
]
return numeric !== undefined
? numeric
: defaultFormId !== undefined
? defaultFormId
: undefined
}
Copy link

Copilot AI Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@Mygod
Copy link
Collaborator

Mygod commented Dec 14, 2025

Separate fix WIP.

@Mygod Mygod closed this Dec 14, 2025
@Fabio1988 Fabio1988 deleted the fix-pokeapi-evo-forms branch December 20, 2025 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants