fix: preserve intentional OS name casing (macOS, iOS, webOS) #61
@@ -30,6 +30,8 @@ type Tab = 'browsers' | 'os' | 'devices' | 'screens'
|
|||||||
|
|
||||||
function capitalize(s: string): string {
|
function capitalize(s: string): string {
|
||||||
if (!s) return s
|
if (!s) return s
|
||||||
|
// Preserve intentional casing (e.g. macOS, iOS, webOS, ChromeOS, FreeBSD)
|
||||||
|
if (s !== s.toLowerCase() && s !== s.toUpperCase()) return s
|
||||||
return s.charAt(0).toUpperCase() + s.slice(1)
|
return s.charAt(0).toUpperCase() + s.slice(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user