Builds a URL by appending query parameters to base. null and undefined values are omitted.
base
null
undefined
The base URL.
Query parameters to append.
buildUrl("https://api.example.com", { page: 1, q: "hello", sort: null })// => "https://api.example.com/?page=1&q=hello" Copy
buildUrl("https://api.example.com", { page: 1, q: "hello", sort: null })// => "https://api.example.com/?page=1&q=hello"
Builds a URL by appending query parameters to
base.nullandundefinedvalues are omitted.