Integers only, so a mistyped `coordinate` still degrades to a shape.
(value: unknown)
| 586 | |
| 587 | /** Integers only, so a mistyped `coordinate` still degrades to a shape. */ |
| 588 | function integerTuple(value: unknown): readonly number[] | undefined { |
| 589 | if (!Array.isArray(value) || value.length === 0 || value.length > 4) return undefined; |
| 590 | return value.every((entry) => typeof entry === 'number' && Number.isInteger(entry)) |
| 591 | ? [...(value as number[])] |
| 592 | : undefined; |
| 593 | } |
| 594 | |
| 595 | /** |
| 596 | * A screen-derived or typed argument, kept as a shape. |
no outgoing calls
no test coverage detected