github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/ui/app/utils/add-to-path.js (about) 1 // Adds a string to the end of a URL path while being mindful of query params 2 export default function addToPath(url, extension = '') { 3 const [path, params] = url.split('?'); 4 let newUrl = `${path}${extension}`; 5 6 if (params) { 7 newUrl += `?${params}`; 8 } 9 10 return newUrl; 11 }