(value: ValueWithLengthOrSize)
| 34 | |
| 35 | /** Gets the length or size of the given value. */ |
| 36 | export function getLengthOrSize(value: ValueWithLengthOrSize) { |
| 37 | const v = value as {length: number; size: number}; |
| 38 | return typeof v.length === 'number' ? v.length : v.size; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Gets the value for an option that may be either a static value or a logic function that produces |