* Removes parameters that start with amp js parameter pattern and returns the * new search string. * @param {string} urlSearch * @return {string}
(urlSearch)
| 457 | * @return {string} |
| 458 | */ |
| 459 | function removeAmpJsParamsFromSearch(urlSearch) { |
| 460 | // The below regex is a combo of these original patterns. Combining these, |
| 461 | // removing the corresponding `.replace` calls, and reusing |
| 462 | // removeParamsFromSearch saves ~175B. Matches params in query string: |
| 463 | // - /[?&]amp_js[^&]*/ amp_js_* |
| 464 | // - /[?&]amp_gsa[^&]*/ amp_gsa |
| 465 | // - /[?&]amp_r[^&]*/ amp_r |
| 466 | // - /[?&]amp_kit[^&]*/ amp_kit |
| 467 | // - /[?&]usqp[^&]*/ usqp (from goog experiment) |
| 468 | return removeParamsFromSearch(urlSearch, '(amp_(js[^&=]*|gsa|r|kit)|usqp)'); |
| 469 | } |
| 470 | |
| 471 | /** |
| 472 | * Removes parameters with param name and returns the new search string. |
no test coverage detected