Function
resolveDirection
(
value: T | 'start' | 'end',
direction: 'ltr' | 'rtl'
)
Source from the content-addressed store, hash-verified
| 490 | } |
| 491 | |
| 492 | function resolveDirection<T extends string>( |
| 493 | value: T | 'start' | 'end', |
| 494 | direction: 'ltr' | 'rtl' |
| 495 | ): T | 'left' | 'right' { |
| 496 | if (value === 'start') { |
| 497 | return direction === 'rtl' ? 'right' : 'left'; |
| 498 | } |
| 499 | if (value === 'end') { |
| 500 | return direction === 'rtl' ? 'left' : 'right'; |
| 501 | } |
| 502 | return value as T; |
| 503 | } |
| 504 | |
| 505 | type Axis = 'x' | 'y'; |
| 506 | |
Tested by
no test coverage detected