(rawValue: string)
| 17 | |
| 18 | /** Resolves a string value to a specific direction. */ |
| 19 | export function _resolveDirectionality(rawValue: string): Direction { |
| 20 | const value = rawValue?.toLowerCase() || ''; |
| 21 | |
| 22 | if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) { |
| 23 | return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr'; |
| 24 | } |
| 25 | |
| 26 | return value === 'rtl' ? 'rtl' : 'ltr'; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * The directionality (LTR / RTL) context for the application (or a subtree of it). |
no outgoing calls
no test coverage detected