refactor: migrate names-generator#1285
Merged
Azgaar merged 6 commits intoJan 27, 2026
Merged
Conversation
✅ Deploy Preview for afmg ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request migrates the names-generator module from JavaScript to TypeScript, converting it from an IIFE pattern to a class-based implementation while maintaining the same public API through the global Names object.
Changes:
- Migrated
names-generator.jsto TypeScript with proper type definitions forNameBaseandMarkovChain - Added type declarations to
global.tsfornameBases,mapName, and utility functions - Updated module import order to ensure
names-generatorloads before dependent modules - Removed the old JavaScript file reference from
index.html
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/modules/names-generator.ts | Complete TypeScript migration of the names generator module with class-based implementation |
| src/types/global.ts | Added type declarations for names-related global variables and utility functions |
| src/types/PackedGraph.ts | Added cultures property to PackedGraph interface |
| src/modules/index.ts | Reordered imports to load names-generator before lakes and river-generator |
| src/index.html | Removed old JavaScript file reference for names-generator |
Comments suppressed due to low confidence (4)
src/modules/names-generator.ts:28
- Extra leading space in the indentation. This line has an extra space before the
forkeyword that is inconsistent with the surrounding code formatting.
src/modules/names-generator.ts:56 - This comparison appears to have incorrect logic. The expression
isVowel(that) === (next as unknown as boolean)casts thenextstring to boolean, which will always be truthy for non-empty strings. The original logic should compare if both characters are vowels. The correct logic should be:isVowel(that) === isVowel(next)
src/modules/names-generator.ts:279 - Spelling error in comment: "generato" should be "generate"
src/modules/names-generator.ts:280 - Missing return type annotation for the
getMapNamemethod. The method can returnundefined(line 281-282) or""(line 286), but no return type is specified. The return type should be explicitly declared asvoid | stringor the method should be refactored to have consistent return behavior.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Azgaar
approved these changes
Jan 26, 2026
Azgaar
left a comment
Owner
There was a problem hiding this comment.
Has to be manually tested a bit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Type of change
Versioning