`if (!string) return searchURL;` — though I can't think of an use case for replacing a query string with nothing...