(url, params)
| 248 | * @return {string} |
| 249 | */ |
| 250 | export function addMissingParamsToUrl(url, params) { |
| 251 | const location = parseUrlDeprecated(url); |
| 252 | const existingParams = parseQueryString(location.search); |
| 253 | const paramsToAdd = {}; |
| 254 | const keys = Object.keys(params); |
| 255 | for (let i = 0; i < keys.length; i++) { |
| 256 | if (!hasOwn(existingParams, keys[i])) { |
| 257 | paramsToAdd[keys[i]] = params[keys[i]]; |
| 258 | } |
| 259 | } |
| 260 | return addParamsToUrl(url, paramsToAdd); |
| 261 | } |
| 262 | |
| 263 | /** |
| 264 | * Serializes the passed parameter map into a query string with both keys |
no test coverage detected