mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-21 11:11:12 -05:00
Fix slug validation and park type detection
This commit is contained in:
@@ -518,15 +518,15 @@ function shouldTrackField(key: string): boolean {
|
||||
|
||||
/**
|
||||
* Normalizes values for consistent comparison
|
||||
* Handles enum-like strings (snake_case) by ensuring lowercase
|
||||
* Handles enum-like strings (snake_case and Title Case) by ensuring lowercase
|
||||
*/
|
||||
function normalizeForComparison(value: any): any {
|
||||
// Null/undefined pass through
|
||||
if (value == null) return value;
|
||||
|
||||
// Normalize enum-like strings to lowercase for comparison
|
||||
// Matches patterns like: "operating", "Operating", "amusement_park", "Amusement_Park"
|
||||
if (typeof value === 'string' && /^[a-zA-Z_]+$/.test(value)) {
|
||||
// Matches patterns like: "operating", "Operating", "amusement_park", "Amusement_Park", "Amusement Park"
|
||||
if (typeof value === 'string' && /^[a-zA-Z_\s]+$/.test(value)) {
|
||||
return value.toLowerCase().trim();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user