Enforce enum types

This commit is contained in:
Idrees Hassan committed 2026-03-28 11:29:35 -07:00
1 parent 7d16459a76
commit b7d6ca63c1
8 files changed
+144 -45

No files matched your search

+3 -2
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) {