(v: number)
| 53 | }; |
| 54 | |
| 55 | export const snapToHalf = (v: number): 0.0 | 0.5 | 1.0 => { |
| 56 | const x = Math.min(1, Math.max(0, v)); |
| 57 | |
| 58 | if (x < 0.25) { |
| 59 | return 0.0; |
| 60 | } |
| 61 | if (x < 0.75) { |
| 62 | return 0.5; |
| 63 | } |
| 64 | |
| 65 | return 1.0; |
| 66 | }; |
| 67 | |
| 68 | export const locationToString = (loc: Partial<TLocation>) => { |
| 69 | if (!loc) { |
nothing calls this directly
no outgoing calls
no test coverage detected