A bound brought inside the range this reading will honour.
(value: number | undefined, fallback: number, maximum: number)
| 181 | |
| 182 | /** A bound brought inside the range this reading will honour. */ |
| 183 | function clamp(value: number | undefined, fallback: number, maximum: number): number { |
| 184 | if (value === undefined || !Number.isFinite(value)) { |
| 185 | return fallback; |
| 186 | } |
| 187 | return Math.min(maximum, Math.max(1, Math.floor(value))); |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * How one symbol is identified across the two readings. |