Enforce enum types

This commit is contained in:
Idrees Hassan
2026-03-28 11:29:35 -07:00
parent 7d16459a76
commit b7d6ca63c1
8 changed files with 144 additions and 45 deletions

View File

@@ -152,8 +152,9 @@ function getColor(part) {
if (currentSpecies.colors[part]) {
return currentSpecies.colors[part];
}
if (DEFAULT_COLOR_OVERRIDES[part]) {
return getColor(DEFAULT_COLOR_OVERRIDES[part]);
const override = DEFAULT_COLOR_OVERRIDES[/** @type {keyof typeof DEFAULT_COLOR_OVERRIDES} */ (part)];
if (override) {
return getColor(override);
}
for (const [color, partName] of Object.entries(COLOR_MAP)) {
if (partName === part) {