(paramName, defaultValue)
| 49 | |
| 50 | |
| 51 | function getVectorParam(paramName, defaultValue) { |
| 52 | const params = new URLSearchParams(window.location.search); |
| 53 | const param = params.get(paramName); |
| 54 | if (!param) { |
| 55 | return defaultValue; // Default value if the parameter is not found |
| 56 | } |
| 57 | const numbers = param.split(',').map(Number); |
| 58 | if (numbers.length !== 3 || numbers.some(isNaN)) { |
| 59 | return defaultValue; // Default value if the parameter is malformed |
| 60 | } |
| 61 | return numbers; |
| 62 | } |
| 63 | |
| 64 | |
| 65 | export function get_position_param() { |
no outgoing calls
no test coverage detected