mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 08:11:13 -05:00
Fix enum value comparison
This commit is contained in:
@@ -527,7 +527,11 @@ function normalizeForComparison(value: any): any {
|
|||||||
// Normalize enum-like strings to lowercase for comparison
|
// Normalize enum-like strings to lowercase for comparison
|
||||||
// Matches patterns like: "operating", "Operating", "amusement_park", "Amusement_Park", "Amusement Park"
|
// Matches patterns like: "operating", "Operating", "amusement_park", "Amusement_Park", "Amusement Park"
|
||||||
if (typeof value === 'string' && /^[a-zA-Z_\s]+$/.test(value)) {
|
if (typeof value === 'string' && /^[a-zA-Z_\s]+$/.test(value)) {
|
||||||
return value.toLowerCase().trim();
|
return value
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/_/g, ' ') // Replace underscores with spaces
|
||||||
|
.replace(/\s+/g, ' ') // Collapse multiple spaces
|
||||||
|
.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively normalize arrays
|
// Recursively normalize arrays
|
||||||
|
|||||||
Reference in New Issue
Block a user