Skip to content

Conversation

@benjiwheeler
Copy link
Contributor

Small refactor as follow-up to #3856

Moves country code lookup logic into the country data library

Copy link
Contributor

@cwillisf cwillisf left a comment

Choose a reason for hiding this comment

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

Looks good!

My one quibble would be that the function names aren't very consistent: lookupCountryInfo looks up a country info object by its two-letter code and lookupCountryName looks up a country info object by its name, which means one function is named for its return type (and could be the name of either function) and the other is named for its argument. If I remember correctly the current lookupCountryInfo is called from quite a few places, though, so renaming that might be too "noisy" to make sense as part of this change. I don't think this is a blocking issue, just a small item of low-interest tech debt.

@benjiwheeler
Copy link
Contributor Author

Thanks for the suggestion! I revised this.

@benjiwheeler benjiwheeler merged commit dc79eb5 into scratchfoundation:develop Jun 19, 2020
@benjiwheeler benjiwheeler deleted the move-to-country-data-lib branch June 19, 2020 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants