Function
resolveDirection
(
value: T | 'start' | 'end',
direction: 'ltr' | 'rtl'
)
Source from the content-addressed store, hash-verified
| 512 | } |
| 513 | |
| 514 | function resolveDirection<T extends string>( |
| 515 | value: T | 'start' | 'end', |
| 516 | direction: 'ltr' | 'rtl' |
| 517 | ): T | 'left' | 'right' { |
| 518 | if (value === 'start') { |
| 519 | return direction === 'rtl' ? 'right' : 'left'; |
| 520 | } |
| 521 | if (value === 'end') { |
| 522 | return direction === 'rtl' ? 'left' : 'right'; |
| 523 | } |
| 524 | return value as T; |
| 525 | } |
| 526 | |
| 527 | type Axis = 'x' | 'y'; |
| 528 | |
Tested by
no test coverage detected