(data: BaseOptionType, index: number)
| 4 | import type { FlattenOptionData } from '../interface'; |
| 5 | |
| 6 | function getKey(data: BaseOptionType, index: number) { |
| 7 | const { key } = data; |
| 8 | let value: RawValueType; |
| 9 | |
| 10 | if ('value' in data) { |
| 11 | ({ value } = data); |
| 12 | } |
| 13 | |
| 14 | if (key !== null && key !== undefined) { |
| 15 | return key; |
| 16 | } |
| 17 | if (value !== undefined) { |
| 18 | return value; |
| 19 | } |
| 20 | return `rc-index-key-${index}`; |
| 21 | } |
| 22 | |
| 23 | export function isValidCount(value?: number) { |
| 24 | return typeof value !== 'undefined' && !Number.isNaN(value); |
no outgoing calls
no test coverage detected
searching dependent graphs…